Code example for ViewPager

0
public class ExtendedViewPager extends ViewPager { 
 
	private boolean mPagingEnabled = true; 
 
	public ExtendedViewPager(final Context context, final AttributeSet attrs) { 
		super(context, attrs); 
		mPagingEnabled = true; 
	} 
 
	@Override 
	public boolean onInterceptTouchEvent(final MotionEvent event) { 
		if (!mPagingEnabled) return false; 
		return super.onInterceptTouchEvent(event); 
	} 
 
	@Override 
	public boolean onTouchEvent(final MotionEvent event) { 
		if (!mPagingEnabled) return false; 
		return super.onTouchEvent(event); 
	}