android - prevent viewPager last page from being selected -
i have viewpager adapter override onpageselected , , want prevent view pager being selected @ last page swipe-able when user leave finger return previous page .
what best way achive ?
thanks in advance !
based on marius answer, used callback when last page selected call view pager set current item smooth scroll.
// view pager adapter public void onpageselected(int index) { if(index == size) communicator.refreshviewpager(); //main activity @override public void refreshviewpager() { pager.setcurrentitem(size -1, true); dmanager.getinstance().scan(1500);
}
Comments
Post a Comment