I have develop ExpandableListView perfectly.
In My ExpandableListView five groups are there. load first time then collapse all five group. it is default.
now my question is load first time expandablelistview at that time 2 groups are expand and other 3 groups are collapse.
so please guide me how to do?
Now I got solution and it will work perfectly.. Please use this..
ExpandableListView Exlist; Exlist.expandGroup(0); Exlist.expandGroup(1);
I built this snippet based off Nikhil's answer. Thought others might find it useful as well. Only works if you are using BaseExpandableListAdapter. elv
ExpandableListView elv = (ExpandableListView) findViewById(R.id.elv_main); elv.setAdapter(adapter); for(int i=0; i < adapter.getGroupCount(); i++) elv.expandGroup(i);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With