You must create your own layout and override the yourInterceptTouchEvent (MotionEvent ev) method of your layout.
As an example, I created my own layout that extends RelativeLayout
@Override public boolean onInterceptTouchEvent(MotionEvent ev) { return true;
And when I clicked a button on my layout, even I clicked on this button, My Layout consumes all touchEvent, since onInterceptTouchEvent
always returns true.
Hope this helps you
source share