xinit wrote:
> Hello
> 
> I am trying to design a UI which utlizes two ListViews on the screen
> at the same time.
> Is this possible ?
> 
> 
> So here is a quick example of how I was intending to do this.
> 
> 1) Create an XML which positions 2 ListViews one onto of the other
> each ListView having there own ID
> 
> <ListView
> android:id="@android:id/list"
> android:layout_width="fill_parent"
> android:layout_height="198px"
> </ListView>
> 
> 
> <ListView
> android:id="@+id/ListView01"
> android:layout_width="192px"
> android:layout_height="215px"
> </ListView>
> 
> 
> 
> 2)  Create two string arrays and populate each listview via
> ArrayAdapter
> 
> private String[] mStrings = {
>             "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam",
> "Abondance", "Ackawi",
>             "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l
> Pitu", "Airag", "Airedale",
>             "Aisy Cendre"};
> 
>     private String[] mStrings2 = {"dsds", "qwqwqq", " dsdsdsd sdsdsds
> ", "dsdsds sdsds"};
> 
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
> 
>         setListAdapter(new ArrayAdapter<String>(this, R.layout.row,
> R.id.label, mStrings));
>         setListAdapter(new ArrayAdapter<String>(this, R.layout.frow,
> R.id.ListView01, mStrings2));
>     }
> 
> 
> 
> This does not work.
> Can anyone advise ?

You cannot use the ListActivity methods for managing the second
ListView. You will need to use findViewById() and handle that ListView
manually.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Training: http://commonsware.com/training.html

--~--~---------~--~----~------------~-------~--~----~
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