public final void goToLastPage(){
  viewPager.setCurrentItem(pages.size() - 1);
}

public final void goToLastPage ( ) { viewPager . setCurrentItem ( pages . size ( ) - 1 ) ; }
navigates to the last page ( if not already there ) .
