I tried to show a simple checklist, and I need to check some items.
Here is my code
ArrayAdapter<Task> taskAdapter = new ArrayAdapter<Task>(this, android.R.layout.simple_list_item_checked, tasksList); this.getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); this.getListView().setItemChecked(2, true); setListAdapter(taskAdapter);
<ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content">
And yet it will not work. Implementing the Checkable interface did not help.
What is the trick of this ListView?
Anton Chertash
source share