I\'m developing android application using expandable list view. Actually what I need is, I\'m listing group, which contains child.
If I select an unexpandable group
If the ExpandableListView has more than 2 groups:
expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
for (int g = 0; g < expandableListAdapter.getGroupCount(); g++) {
if (g != groupPosition) {
expandableListView.collapseGroup(g);
}
}
}
});
It will collapse all groups except the clicked one.