android View with View.GONE still receives onTouch and onClick

后端 未结 9 2130
温柔的废话
温柔的废话 2020-12-13 03:40

This is confusing me:

As far as I have read, a view with setVisibility(View.GONE); should not receive any more touch- or click events. My layout has two parts, which

9条回答
  •  抹茶落季
    2020-12-13 04:12

    I would have post this as a comment, but unfortunately I was not able to post a comment. As it could be a possible solution for you, i post it that way:

    As you write "onClick" I assume you're using the onClick attribute in your XML layout. Try to set an OnClickListener with setOnClickListener instead of the onClick attribute. Maybe this helps...

提交回复
热议问题