Miya
Miya

Reputation: 547

problem with ExpandableListView in Android

I have one activity (Home.class), and that activity contains 3 views:

first_view.xml, second_view.xml,third_view.xml

first_view.xml contains 2 buttons (btnSecond and btnThird). If I click btnSecond, second_view.xml will appear. If I click btnThird, third_view.xml will appear.

In the third view there is a ExpandableListView. So I extend ExpandableListActivity in the Home.class. But now there is a problem.

When I am running, an exception occurs:

java.lang.RuntimeException: Your content must have a ExpandableListView whose id attribute is 'android.R.id.list'

When I use ExpandableListView in all xml files, the problem is solved. But I want to display this list only in third_view.xml. How can I solve this problem?

Upvotes: 1

Views: 2256

Answers (1)

atomSmasher
atomSmasher

Reputation: 1465

Make sure you name the list view "@android:id/list". Go here for more info.

Upvotes: 2

Related Questions