> Do you see anythings wrong ?

No, but can you tell me where it crashes?

> I don't understand why you wrote "list" in  "list.setAdapter" and why
> you wrote "this.android.R.layout.list_item, array_list" instead of
> "R.layout.list_item".

Sorry, my post had a typo. It should be this:

                listAdapter = new ArrayAdapter<String>(
                        this,
                        R.layout.your_list_row,
                        R.id.row_text,
                        your_array_list_of_strings);
                listView.setAdapter(listAdapter); // or, if you're
using a ListActivity instead of a ListView, just say this.setAdapter
(listAdapter);

For the layout your_list_row.xml, put this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >

        <TextView android:id="@+android:id/row_text"
                android:layout_width="wrap_content"
                android:layout_height="50.0sp"
                />

</LinearLayout>


There are a number of tutorials for using ArrrayAdapter, they may also
help.



Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

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