How to make gesture of mapview works in scrollview Sep 6, 2018 Customize scrollview to disable touch events in MapView rect. public final class MapScrollView extends ScrollView { private View touchView; private final Rect rect = new Rect(); public MapScrollView(Context context) { this(context, null); } public MapScrollView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { super.onFinishInflate(); touchView = findViewById(R.id.map_view); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { final int action = ev.getAction(); final int actionMasked = action & MotionEvent.ACTION_MASK; if (actionMasked == MotionEvent.ACTION_DOWN) { int x = (int) ev.getRawX(); int y = (int) ev.getRawY(); touchView.getGlobalVisibleRect(rect); if (rect.contains(x, y)) { return false; } } return super.onInterceptTouchEvent(ev); } } Please enable JavaScript to view the comments powered by Disqus.