I know it is possible to graphically toggle the checked state of an item in a ListView. But how is this done? I have a ListView containing several CheckedTextView items, and I've tried setting the checked state of these items by calling
list.setItemChecked(arg2, false);
and respectively
list.setItemChecked(arg2, true);
This is called in the OnItemClickedListener of my ListView, so the arg2 is the index of the item clicked. Nevertheless, the item doesn't get checked. Is there a call to the listAdapter that I'm missing? Or what could this be?
What layout are you using for the ListItems? android.R.layout.simple_list_item_multiple_choice?
Your android:choiceMode also has to be set to either singleChoice or multipleChoice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With