android View with View.GONE still receives onTouch and onClick

Solution 1:

Do you maybe use animations to show/hide the views? I get this behaviour when I use animations that have android:fillEnabled="true" android:fillAfter="true" Don't understand it, and seems like a bug - if I use animations without fillEnabled/fillAfter, all works as expected...

Solution 2:

If you set setVisibility(View.GONE) after some animation (fade out, for example), then try clearing the animation with clearAnimation(). This is what helped me.

Solution 3:

Try setting clickable property to false using setClickable(false) after setVisibility(View.GONE)