How to clear the ExpandableListView?

366 Views Asked by At

I am using expandable list view as a tree view structure and it needs to be updated continuously but as I can not clear the current expandable list view, it shows the previous data along with new data. Like if I minimize and again open app there is duplicate data in list view.

2

There are 2 best solutions below

0
Hossein Amini On
yourExpandableListView.setAdapter((BaseExpandableListAdapter)null);
3
archana On

ExpandableListAdapter adapter = new ExpandableListAdapter(); //or what ever adapter you use/created listView.setAdapter(adapter) Please try this