How to disable touch event android?
Do nothing but just return true in onTouchEvent().
If you are using any view, use android:clickable="false" as view's attribute in the xml.
I solved like below,
 view.setClickable(true);
            view_activity.setOnTouchListener(new OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    if (view_activity.isClickable()) {
                        if (isOpened)
                            closeMenu();
                 return false;
                    }
                else
                    return true;                    
                }
            });
                        if it's a View, you can use his method setClickable(false)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With