Hi in your xml change the bold item you must specify the id respect to *...@android:id/list not @+id/list*
<ExpandableListView android:id="*...@android:id/list*" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> Thank you. On Wed, Mar 3, 2010 at 5:52 PM, YCH <yip....@gmail.com> wrote: > 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<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Thank you Dilli Rao -- 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