Android : Multiple Actions on a List View - Focus Issue

前端 未结 6 980
醉酒成梦
醉酒成梦 2021-02-06 02:55

I would like to implement a ListView, which I can do no problem w/ my cursor. Right now depending on which row you click on it takes you to a new activity based on the informati

6条回答
  •  灰色年华
    2021-02-06 03:12

    Another possible workaround - you can use an ImageView instead of the button, and set the ImageView's onClickListener (For example, when you're inflating the cell view).

    ImageView is not focusable so it doesn't prevent OnListItemClick() from being dispatched, and when you click on the image only the image's listener fires.

提交回复
热议问题