我在我的项目中使用ExpandableListView。我面临的问题是 - 在我扩展几个组并关闭它们(并多次这样做)之后,ExpandableListView没有响应(占用大量的CPU资源)。我不知道确切的原因。以下是我的所作所为: (我在Android 2.2操作系统上进行了测试)
XML布局
<ExpandableListView android:id="@+id/explistView"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:groupIndicator="@null"
android:divider="@android:color/transparent"
android:cacheColorHint="#00000000"/>
适配器
ExpandableListView explistView = (ExpandableListView) findViewById(R.id.explistView);
explistView.setAdapter(new SimpleExpandableListAdapter(this));
// SimpleExpandableListAdapter extends BaseExpandableListAdapter