How to keep ExpandableListView in expanded status?

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

I use

SimpleExpandableListAdapter

in my

ExpandableListActivity

When user click th

6条回答
  •  被撕碎了的回忆
    2020-12-14 09:38

    I was browsing around trying to find a solution to my own ExpandableListView problem. Anyway, add my 2 cents to the answer provided by adstro.

    The concept is simple: First call the getGroupCount() function of the ExpandableList Adapter to find the number of groups Then, loop through the groups and call the expandGroup(int GroupPos) function of the ExpandableList View to expand each group.

    The above codes should be put inside onCreate() and also the onResume() to cater for both the first creation and the return to the activity subsequently after creation.

提交回复
热议问题