On Mar 3, 5:22 pm, YCH <[email protected]> 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
Hi ... did u tried changing the following line android:id="@+id/list" to something like android:id="@android:id/list" See if it works ... :) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

