Disable the touch events for all the views

前端 未结 13 1408
暗喜
暗喜 2020-11-28 06:53

What\'s the best way to disable the touch events for all the views?

13条回答
  •  我在风中等你
    2020-11-28 06:57

    Per your comment:

    i just want to be able to disable the views of the current activity at some point

    you seem to want to disable all touch for the current activity regardless of the view touched.

    Returning true from an override of Activity.dispatchTouchEvent(MotionEvent) at the appropriate times will consume the touch and effectively accomplish this. This method is the very first in a chain of touch method calls.

提交回复
热议问题