Reputation: 1549
I am using ViewPager with sliding Screen as given here : http://developer.android.com/training/animation/screen-slide.html.
But I am always getting five pages even I have changed NUM in Activity .But still it is only displaying five pages. Is there any limit to this . If yes how could I overcome this problem I need to show around 20 pages of this?
Please help ?
Upvotes: 0
Views: 272
Reputation: 1165
private static final int NUM_PAGES = 5;
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
public ScreenSlidePagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return new ScreenSlidePageFragment();
}
@Override
public int getCount() {
return NUM_PAGES;
}
}
Your adapter is always returning 5 to getCount method. Just change that with the size of your collection
Upvotes: 1