Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a CheckBox to ListView item prevents it from being able to receive ItemClick

In the Adapter for the ListView, I return a LinearLayout, in which I add a Checkbox, a ImageView and a TextView. This basically constructs a ListView, in which each item contains a Checkbox, a ImageView and a TextView. However the strange thing is that if I don’t add the Checkbox, then ListView receives onItemClick event correctly, as long as I add the Checkbox, onItemClick of the ListView never gets fired again, as if the Checkbox eats all the OnClick event passed to ListView.

Any ideas how can I solve this? I want the user to be able to check/uncheck the Checkboxes and at the same time be able to click on these ListView items as well if they click on area for the ListView item other than the checkbox.

like image 908
Echo Lu Avatar asked Feb 14 '10 01:02

Echo Lu


1 Answers

Set all items focusable="false"

like image 197
jax Avatar answered Oct 17 '22 06:10

jax