Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public void onPageSelected(int position) {
  2. // skip fake page (first), go to last page
  3. if (position == 0) {
  4. ((ViewPager) container).setCurrentItem(3, false);
  5. }
  6.  
  7. // skip fake page (last), go to first page
  8. if (position == 4) {
  9. ((ViewPager) container).setCurrentItem(1, false); //notice how this jumps to position 1, and not position 0. Position 0 is the fake page!
  10. }
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement