How to solve error: Could not find method onClick(View) in a parent or ancestor Context for android:onClick

后端 未结 5 1254
太阳男子
太阳男子 2020-12-20 19:27

I have seen that there\'s been some similar questions but the answers to those haven\'t helped me so far. The full error:

java.lang.IllegalStateExcept

5条回答
  •  鱼传尺愫
    2020-12-20 19:57

    In my case I missed closing bracket at the end.

    android:onClick="@{(v) -> CommentHandler.selectGallery(v)".

    It should be like this.
            android:onClick="@{(v) -> CommentHandler.selectGallery(v)}".
    

提交回复
热议问题