Changing ListActivity to just Activity worked like a charm. You are a life saver. Thanks a lot.
Thanks, KK On Sun, Dec 25, 2011 at 3:10 PM, YuviDroid <[email protected]> wrote: > Hi, > > I believe you are using a ListActivity, which by default looks for a > ListView with id "@android:id/list". To use custom ids change that > ListActivity to a normal Activity. > > > Cheers, > Yuvi > http://www.droidahead.com > > On Sun, Dec 25, 2011 at 9:55 AM, KK <[email protected]> wrote: > >> hi all, >> I'm using FrameLayout and have defined two LinearLayouts embedded inside >> the FrameLayout. Now for each LinearLayout I've a listview . The problem >> I'm facing is picking the two listviews separately from my Java side code. >> The default listivew in XML uses the standard defined ID as >> *android:id="@id/android:list" >> *and I'm not able to pick the right one. So I decided to give custom ids >> to each of the list view like this in Layout1: >> <ListView >> android:id="@+id/list1" >> android:layout_width="fill_parent" >> android:layout_height="fill_parent" /> >> >> and the following in Layout2 >> >> <ListView >> android:id="@+id/list2" >> android:layout_width="fill_parent" >> android:layout_height="fill_parent" /> >> >> and this is what I'm trying to use to pick the listviews separately, >> >> ListView listView1 = (ListView) findViewById(R.id.list1); >> ListView listView2 = (ListView) findViewById(R.id.list2); >> >> With the above code in pace, I'm not getting any compilation errors. But >> during run time I'm getting errors with this message: >> * java.lang.RuntimeException: Your content must have a ListView >> whose id attribute is 'android.R.id.list'* >> >> Are we not allowed to use custom IDs for listviews? If custom IDs are not >> allowed, then what is the best way to handle the above problem? Would >> appreciate if someone could point me to the right direction. >> >> BTW, I'm actually trying to define two layouts each with its own listview >> and then I'm trying to animate between two UI screens each using one layout >> and the default behavior gives only one of the listivew as picked by >> "getListView()" which happens to be the 1st one, so my 2nd UI page is not >> showing any listview. >> >> >> Thanks, >> KK >> >> -- >> 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 > > > > > -- > YuviDroid > Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget > to quickly access your favorite apps and contacts!) > http://android.yuvalsharon.net > > -- > 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 -- 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

