Your content must have a ExpandableView whose id is attribute is 'android.R.list'
This is the error message I am getting from Logcat. Which is confusing me as my XML is this
<?xml v开发者_开发知识库ersion="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ExpandableListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
try this
<ExpandableListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
ExpandableListView
when you define id like this @+id/list means that you define an id name list in your application namespace and you can refer to it by @id/list , but @android:id/list means that you are referring to an id define in the android namespace This namespace is the namespace of the framework
In your XML make this android:id="@+id/list" to this android:id="@android:id/list". It will solve your problem.
See this link for more help.
精彩评论