I am using the android design library TabLayout in that how can I get the 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 the Support library the TabLayout has a method getSelectedTabPosition
.
Source 1 | Source 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With