Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fold all ChildView Group in Android ExpandableList Item?

How can I fold all ChildView Group in Expandable List. Now I have two buttons to control Expand All and Fold All on Activity. Expandable button is OK and it is working work but I don't know how to fold all ChildView Group. How can i do this ?

Thanks

**expandableListView.expandGroup(position, true); = OK<Br>

expandableListView.foldGroup(position) = ? or ?**
like image 901
Kyaw Kyaw Avatar asked Jan 16 '26 20:01

Kyaw Kyaw


1 Answers

try this,

int count = (new ExpAdapter(this)).getGroupCount();
        b.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                for (int i = 0; i < count; i++)
                {
                    expList.collapseGroup(i);
                }

            }
        });
like image 183
Sahil Mahajan Mj Avatar answered Jan 19 '26 18:01

Sahil Mahajan Mj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!