Code example for ViewPager

Methods: getAdaptergetCurrentItemonTouchEvent

0
        } 
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        return canSlide() && super.onTouchEvent(ev);
    } 
 
    private boolean canSlide() { 
        final ValidationViewPagerAdapter adapter = (ValidationViewPagerAdapter) getAdapter();
        return adapter.isFragmentValid(getCurrentItem());
    } 
 
}