The id problem would be that you try to define list2 as being an id
provided by android itself (@android:id) but it doesn't exist. It's
not something you just make up.

What I did to make your example work was to change list2 to be
android:id="@+id/list2"
Then for testing, here's how I set the adapters...

                String[] mStrings = new String[] { "a", "b", "c" };
                setListAdapter(new ArrayAdapter<String>(this,
                                android.R.layout.simple_list_item_1, mStrings));

                String[] mStrings2 = new String[] { "d", "e", "f" };
                ListView secondList = (ListView) findViewById(R.id.list2);
                secondList.setAdapter(new ArrayAdapter<String>(this,
                                android.R.layout.simple_list_item_1, 
mStrings2));

Note the first setListAdapter is set up to interact with the first
ListView in my ListActivity.

On Mar 31, 10:07 pm, Gazpacho <[EMAIL PROTECTED]> wrote:
> I'd like to create two columns of ListViews in Android.  Is this
> possible?
>
> This is giving me errors with the id naming:
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>                                 android:layout_width="fill_parent"
>                                 android:layout_height="fill_parent">
>
>         <ListView    android:id="@android:id/list"
>                                 android:layout_width="100px"
>                         android:layout_height="fill_parent" />
>
>         <ListView    android:id="@android:id/list2"
> android:layout_toRight="@android:id/list"
>                                 android:layout_width="100px"
>                         android:layout_height="fill_parent" />
> </RelativeLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to