I’m using FragmentPagerAdapter with a tabbed interface. My interface happens to have three tabs. I can see that as soon as my app is created, the adapter requests that both tabs one and two both be created immediately (I assume this is so swiping to the next tab appears smooth to the user).
Is there a way to stop the automatic loading of the next tab? My tabs are pretty heavy, and loading two right at startup is taking a good deal of time,
Thanks
Sorry, no. This is driven by
setOffscreenPageLimit(), and the minimum value is 1, meaning thatViewPagerwill always try to create and hold onto at least 1 page on each side.It sounds like you need to move more logic into background threads.