How to get the current selected item position using TabLayout in Android Design Library -


i using android design library tablayout in how can current selected item tab position.

  viewpager pager = (viewpager) view.findviewbyid(r.id.pager);         mypageradapter adapter = new mypageradapter(getchildfragmentmanager());   pager.setadapter(adapter);   tablayout.setupwithviewpager(pager); 

as of version 22.2.1 of support library tablayout has method getselectedtabposition.

source 1 | source 2


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -