mardi 9 mai 2017

ExpandableListView with Checkboxes for Groups and Children in Android

i want to add an ExpandableListView to my Android-App. Just 2 levels: a group-level and one child level.

At both of the levels i want to have a checkbox.

  • If the user checks the checkbox of a group checkboxes of all related children will automatically be checked; the same for unchecking a group.
  • The user can also check / uncheck checkboxes at child-level. If some, but not all children of a group are checked the checkbox of the group will be in indifferent state (i will be using a tri-state checkbox for this).

Any idea how i could implement this?

It is important to maintain the checked state of the checkboxes, this means to initialize the state of each checkbox when the activity or dialog is created and to save the state when the user closes the activity or dialog.

Thanks for your support!

Gerhard




Aucun commentaire:

Enregistrer un commentaire