Hi all,

I am encountering an exception in the onCreate method of an activity.

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

The onCreate method is as below.

public class TestActivity extends ExpandableListActivity {

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                this.setContentView(R.layout.tab1);
                registerForContextMenu(getExpandableListView());
                getData();
        }
........................

The layout view XML is as below.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android";
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">
<ExpandableListView
        android:id="@+id/list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</LinearLayout>

I've already changed the ID of the ExpandableListView to "list". But
it is not effective.

Any ideas on what's wrong? Thanks!

Thanks & Regards,
YCH

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to