Frage

I am retrieving contacts and displayed it in listview using simpleCursorAdapter. listView is displayed in main.xml and my textview and checkboxes are in listview.xml. My main.xml also have 2 buttons, named selectAll, clearAll which on click event should check all the checkboxes true and false respectively. Button click listener event calls the inflated view to access the checkbox but it is still not checking true. Pls help!

Thanks in advance!

War es hilfreich?

Lösung

When you inflate a view, it's not to access it, it's creating it, and you can't access all check boxes cause you don't generate all of them, you'll need to hold a data model that holds data about who is selected.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top