I just started learning android.Hope this isn’t silly question.Here it is
My FragmentAdapter has a List of Fragments,Say 3 Fragments 1,2,3.
I have set this FragmentAdapter for my ViewPager using myViewPager.setAdapter(myFragmentAdapter);
So this application kicks off by displaying view of Fragment 1.How do I start the Application by displaying Fragment 2’s View first.
You can use
setCurrentItem(index)to switch your current page.In this case, you would want to do:
See the ViewPager docs for more information. You may wish to use the variation of this method which allows you specify where there should be a smooth scroll, and set it as
false, otherwise the user may see the animation the moment the app opens and it could be confusing. For example,