Code example for ViewPager

Methods: getAdaptergetCurrentItemsetCurrentItem

0
    } 
 
    public boolean pageForward(boolean smoothScroll) {
        if (mLock == LOCK_BOTH || mLock == LOCK_FORWARD) return false;
 
        if (getAdapter() != null && getCurrentItem() < (getAdapter().getCount() - 1)) { 
            setCurrentItem(getCurrentItem() + 1, smoothScroll);
            return true; 
        } 
        return false; 
    } 
 
    public boolean pageBackward(boolean smoothScroll) {
        if (mLock == LOCK_BOTH || mLock == LOCK_BACKWARD) return false;
 
        if (getCurrentItem() > 0) { 
            setCurrentItem(getCurrentItem() - 1, smoothScroll);
            return true; 
        } 
        return false; 
Connect your IDE to all the code out there  Get Codota for Java