Expand all children in expandable list view

后端 未结 5 1653
谎友^
谎友^ 2020-12-15 02:21

I would like to expand all children while the expandable list view is populated. Currently my code looks like this:

ExpandableListView listView = (Expandable         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 02:48

    I have tried the responses listed but i found that i can use the getGroupCount() method to get the number of groups.

    Using this method i can iterate and expand every group of my ExpandableListView

    for (int i = 0; i < myExpandableListView.getExpandableListAdapter().getGroupCount(); i++) {
          //Expand group
          myExpandableListView.expandGroup(i);
     }
    

提交回复
热议问题