Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FragmentStateAdapter select current fragment. Viewpager select current fragment
int id = viewPager.getCurrentItem();
FragmentStatePagerAdapter adapter = (FragmentStatePagerAdapter) viewPager.getAdapter();
Fragment fragment = (Fragment) adapter.instantiateItem(viewPager, viewPager.getCurrentItem());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.