-2

android View pager load two pages at a time into memory.i want to load one page at a time and call when page scrolled is it possible?

how can i load one page at a time when user scrolled then call second fragment?

RAMU PAL
  • 149
  • 1
  • 11

1 Answers1

0

actually it is 3. view pager always load 3 pages or to be exact 3 fragments into memory. this insures user doesn't encounter a frame drop. but there is a catch:

we have two kind of view pager adapter: FragmentPagerAdapter and FragmentStatePagerAdapter .

if you have fragments with heavily content i suggest FragmentStatePagerAdapter because it doesn't load all 3 fragments together. it loads the first one and the save only the states of the other two. its better in case you want to manage memory for heavily content Fragments

hadi
  • 1,104
  • 8
  • 23