Load only one Fragment in ViewPager

kirankk picture kirankk · Jul 12, 2013 · Viewed 17.9k times · Source

I have used ViewPager with Fragment.
But it loads two pages at time.
Is there any way to load only one page in viewpager ?

Answer

SKK picture SKK · Jul 12, 2013

This might be the thing you are looking for:

  mPager.setOffscreenPageLimit(n); // where n is the number of offscreen pages you want to load.

**The minimum value of it can be "1" as you said. ** check this link and also read the comments.