I want to suppress the touchscreen input in my App sometimes.

I tried this:

public boolean dispatchTouchEvent(MotionEvent ev) {
    super.dispatchTouchEvent(ev);
    return true; // or false
}

But it made no difference...

有帮助吗?

解决方案

Do not call through to to your Super, just return.

This overridden method is so that you can add in your own functionality, but sending it to the super, still passes the touch on to the system to handle.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top