Code example for ViewPager

import android.view.SurfaceView; 
import android.view.View; 
public class MapAwarePager extends ViewPager { 
  public MapAwarePager(Context context, AttributeSet attrs) { 
    super(context, attrs); 
  protected boolean canScroll(View v, boolean checkV, int dx, int x, 
                              int y) { 
    if (v instanceof SurfaceView || v instanceof PagerTabStrip) { 
    return(super.canScroll(v, checkV, dx, x, y)); 
Connect your IDE to all the code out there  Get Codota for Java