Custom ListView click issue on items in Android

The issue is that Android doesn’t allow you to select list items that have elements on them that are focusable. I modified the checkbox on the list item to have an attribute like so:

android:focusable="false"

Now my list items that contain checkboxes (works for buttons too) are “selectable” in the traditional sense (they light up, you can click anywhere in the list item and the “onListItemClick” handler will fire, etc).

EDIT: As an update, a commenter mentioned “Just a note, after changing the visibility of the button I had to programmatically disable the focus again.”

Leave a Comment