How to keep ExpandableListView in expanded status?

后端 未结 6 1620
北恋
北恋 2020-12-14 09:19

I use

SimpleExpandableListAdapter

in my

ExpandableListActivity

When user click th

6条回答
  •  -上瘾入骨i
    2020-12-14 09:43

    I did something similar, except I keep all the groups expanded all the time. To accomplish this, I got a handle to the listView via ExpandableListActivity.getExpandableListView() and use ExpandableListView.expandGroup (int groupPos) to expand the groups.

    For your scenario, you could keep track of which group(s) is/are expanded and once the activity to loaded again, re-expand them.

    Hope this helps.

    One other thing...I put this code in OnCreate().

提交回复
热议问题