I want to make only one item in the parent list expand at a time, my code for the onCreate is currently the following. (It works as I want, But the method to allow only one pare
Modified the answer from Iram: So you can reopen the same Group
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
if (prevouriousExpandedGroupNumber != -1 && prevouriousExpandedGroupNumber != groupPosition) {
expListView.collapseGroup(prevouriousExpandedGroupNumber);
}
prevouriousExpandedGroupNumber = groupPosition;
}
});