[ACCEPTED]-how to disable touch event android-touch

Accepted answer
Score: 10

Do nothing but just return true in onTouchEvent().

If 2 you are using any view, use android:clickable="false" as 1 view's attribute in the xml.

Score: 3

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;                    
                }
            });

0

Score: 2

if it's a View, you can use his method setClickable(false)

0

More Related questions