0

I have simple expandable list view, that I would like to collapse when it is expanded. Something like auto collapser. How to collapse a group, when group is expanded? I don't know why, but my method does not work :/

MainActivity

.....
     // get the listview
            expListView = (ExpandableListView) findViewById(R.id.lvExp);

            // preparing list data
            prepareListData();

            listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);

            // setting list adapter
            expListView.setAdapter(listAdapter);




            // Listview Group expanded listener
           expListView.setOnGroupClickListener(new OnGroupClickListener() {

                @Override
                public boolean onGroupClick(ExpandableListView parent, View v,
                        int groupPosition, long id) {

                  parent.collapseGroup(groupPosition);




                    return false;
                }


            });

....
4

1 回答 1

0

The other code in that file was blocking this one.

于 2014-05-08T07:48:37.430 回答