public final void goToNextPage(){
  final boolean isLastPage=viewPager.getCurrentItem() == (pages.size() - 1);
  if (!isLastPage) {
    viewPager.setCurrentItem(viewPager.getCurrentItem() + 1,true);
  }
}

public final void goToNextPage ( ) { final boolean isLastPage = viewPager . getCurrentItem ( ) == ( pages . size ( ) - 1 ) ; if ( ! isLastPage ) { viewPager . setCurrentItem ( viewPager . getCurrentItem ( ) + 1 , true ) ; } }
navigates to the next page ( if not already there ) .
