Reputation: 469
I have a ListView with checkboxes in it. When I click on a element of the ListView, it does not check/uncheck the checkbox. I want to toggle the checkbox if the user clicks on the checkbox or on the listview.
How can I do that ?
Thank you
Upvotes: 0
Views: 129
Reputation: 1856
In order to get the click listener of CheckBox in each row of list view, you can add the setOnCheckedChangeListener of checkbox in getView() method of your custom adapter.
Upvotes: 0
Reputation: 25058
Listen for the click event and adjust the state of the CheckBox
. The onClick
gives you the View
that was clicked so you should be able to get the CheckBox
easily.
Upvotes: 1