Android listview item click is not working

前端 未结 3 1992
逝去的感伤
逝去的感伤 2020-12-10 10:06

I have seen similar questions and tried the solutions such as setting focusable to false but it is still not working. Here is my layout that contains the listview:



        
3条回答
  •  无人及你
    2020-12-10 10:24

    Actually nothing is wrong.

    But the problem is from the custom_list_row.xml, when you click on the list view item,

    You actually click on other tags in your custom_list_row.xml

    and these tags are not responsible for firing the ItemClickListener.

    Change value of property android:layout_width of tags in the custom_list_row.xml to "wrap_content" or remove the tags and try again.

提交回复
热议问题