Code example for ViewPager

0
import android.view.MotionEvent; 
 
public class NestableViewPager extends ViewPager { 
 
    public NestableViewPager(Context context, AttributeSet attrs) { 
        super(context, attrs); 
    } 
 
    /** 
     * Prevent horizontal scrolling 
     */ 
     @Override 
    public boolean onInterceptTouchEvent(MotionEvent event) { 
         return false; 
    } 
 
}