I\'m trying to use Fragment with a ViewPager using the FragmentPagerAdapter. What I\'m looking for to achieve is to replace a fragment, positioned
ViewPager
FragmentPagerAdapter
In your onCreateView method, container is actually a ViewPager instance.
onCreateView
container
So, just calling
ViewPager vpViewPager = (ViewPager) container; vpViewPager.setCurrentItem(1);
will change current fragment in your ViewPager.