Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clear ExpandableListView

I am using an ExpandableListView along with a ViewPager so in onPageSelected() I need to clear the list.

I know one way to do it for a ListView is setAdapter(null) but I get The method setAdapter(ListAdapter) is ambiguous for the type ExpandableListView error if I try it on ExpandableListView.

like image 843
hypd09 Avatar asked Jan 14 '14 13:01

hypd09


1 Answers

Try by type casting null with BaseExpandableListAdapter like below.

listview.setAdapter((BaseExpandableListAdapter)null);
like image 64
Prasad Avatar answered Sep 20 '22 19:09

Prasad