Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

instantiate all items in view pager android

I have an activity with a view pager and three pages to display. When ever the activity loads, only the first two pages are instantiated i.e instantiateitem in the pageradapter class is called only for position 0 and 1. Is there a way to instantiate all the three pages?

like image 640
user1253887 Avatar asked Apr 06 '12 16:04

user1253887


1 Answers

Try setOffScreenPageLimit(2). By default only one page to the left and to the right are instantiated. By setting to 2 it should instantiate your 3 pages.

like image 68
znat Avatar answered Oct 22 '22 20:10

znat