Skip to content

Instantly share code, notes, and snippets.

@Nkzn
Created March 6, 2012 12:50
Show Gist options
  • Save Nkzn/1986112 to your computer and use it in GitHub Desktop.
Save Nkzn/1986112 to your computer and use it in GitHub Desktop.
ExpandableListAdapter adapter = expandableListView.getExpandableListAdapter();
int groupCount = adapter.getGroupCount();
for(int i=0; i < groupCount; i++) {
int childCount = adapter.getChildrenCount(i);
View groupView = adapter.getGroupView(i, false, null, expandableListView);
CheckBox cbGroupSelected = (CheckBox) groupView.findViewById(R.id.cb_group_selected);
cbGroupSelected.setOnCheckedChangeListener(this);
for(int j=0; j < childCount; j++) {
View childView = adapter.getChildView(i, j, false, null, expandableListView);
CheckBox cbChildSelected = (CheckBox) childView.findViewById(R.id.cb_child_selected);
cbChildSelected.setOnCheckedChangeListener(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment