FragmentStatePagerAdapter creates about 3 fragments each time. I'd like it to create say 10 fragments to populate the viewpager at once. I dont see any methods to change the default. Im dealing with a large number of items and each fragment in the adapter makes a network call thus some overhead on each new page traversal. I'd like to cut it down by keeping more items in the adapter at once.
Asked
Active
Viewed 365 times
1 Answers
0
Get a hold of your ViewPager
and use setOffscreenPageLimit(10);

Emmanuel
- 13,083
- 4
- 39
- 53
-
This return java.lang.IllegalStateException: Fragment already added: error. – alicanbatur Feb 18 '14 at 14:09