Is it possible to save and restore the state (which items are collapsed and which not) of an ExpandableListView in Android?
If it is possible, how can I do that?
Improving Floaf's answer: declare
public static int firstVisiblePosition=0;
on Pause
int numberOfGroups = MyExpandableListViewAdapter.getGroupCount();
boolean[] groupExpandedArray = new boolean[numberOfGroups];
for (int i=0;i
onResume
for (int i=0;i
This will not only restore each group's state but it will also scroll to the childView that was viewed when activity paused.