How to find the "last page" in a view pager. Or the total 'number' of views. Android Development
You should be using ViewPager.getAdapter().getCount() The getAdapter() method returns the object that supplies the pages for the ViewPager.
You should be using ViewPager.getAdapter().getCount() The getAdapter() method returns the object that supplies the pages for the ViewPager.