2014-01-14 1 views
5

ViewPager과 함께 ExpandableListView을 사용하고 있습니다. onPageSelected() 목록을 지울 필요가 있습니다.clear expandableListView

나는 ListView에 대해 그것을 수행하는 한 가지 방법을 알고 있지만 ExpandableListView에서 시도하면 The method setAdapter(ListAdapter) is ambiguous for the type ExpandableListView 오류가 발생합니다.

답변

6

빈 어댑터를 입력 해 보셨습니까? 다음과 같은 뭔가 :

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

이렇게하면 널 포인터를받지 않습니다 어댑터 채우고// 쇼를 표시 할 요소를 포함하지 않습니다 null이 어댑터입니다. adapter 아래 같은 BaseExpandableListAdapter와 타입 캐스팅 널 (null)에 의해 isEmpty()

+0

감사합니다. – hypd09

9

시도를 호출하여 비어있는 경우

당신은 확인할 수 있습니다.

listview.setAdapter((BaseExpandableListAdapter)null); 
+0

감사합니다. – oguzhan