Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Get number of groups in ExpandableListView?

is there a way to get the number of groups in an ExpandableListView? Or do I have to "remember" how many group items I have added?

like image 988
jellyfish Avatar asked Dec 05 '22 22:12

jellyfish


1 Answers

You can get the group count through the ExpandableListView's adapter:

ExpandableListView v;
[...]
final int groupCount = v.getExpandableListAdapter().getGroupCount();
like image 197
rekaszeru Avatar answered Dec 07 '22 10:12

rekaszeru