ListView with clickable/editable widget

Is it possible to use a OnItemClickListener on a ListView when the Items layout has a clickable/editable widget (RadioButton,EditText, or CheckBox)?


Solution 1:

You might want to take a look at this issue. Having a focusable item in a row of a ListView causes the OnItemClickListener NOT to be invoked. However, that does not mean you cannot have focusable/clickable items in a row, there are some workarounds like this one.

Also, you can take a look at the Call Logs screen. It has a ListView with clickable item(the call icon on the right). See Source code here

Solution 2:

Quoting comment #31 in the link mentioned by Samuh (which solved the problem for me):

In fact you can add it to the layout XML (if inflated by one): android:descendantFocusability="blocksDescendants".

Adding here JIC that webpage is down in the future.