ViewPager has a public function setOffscreenPageLimit (http://developer.android.com/reference/android/support/v4/view/ViewPager.html#setOffscreenPageLimit(int)), What is it? Her
setOffscreenPageLimit() is normally, we use to set limit of pages that will set in idle state. this method we use when you have a long list of pages in view pager. this method keep away to occurred low memory error and also beneficial when you set lazy loading on pager.
Just like this.
public class FragmentSample extends Fragment{
...
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
// load you data
}
}
...
}
Lazy load data for ViewPager Items
maybe you can see my answer which use setUserVisibleHint() to customer a fragment