Listview itemclick not work

后端 未结 6 1502
深忆病人
深忆病人 2020-11-27 20:33
  1. I have a ListView in my ListView show ImageButton.

  2. I set focusalble \"false\" and focusableInTouchMode \"false\" to ImageButton.

  3. I s

6条回答
  •  再見小時候
    2020-11-27 20:38

    Actually nothing is wrong. What you are doing is ok. But i think you forgot one key factor here ImageButton has it's own OnClickListener. So when you embed your ImageButton into the listview row ListView.OnItemClickListner is not working because the click/touch is invoked by ImageButton, it's because of that ListView is not getting your click/touch event. Checkout this link: How to fire onListItemClick in Listactivity with buttons in list?

提交回复
热议问题