Android A basic ListView with an ArrayAdapter


By default the ArrayAdapter creates a view for each array item by calling toString() on each item and placing the contents in a TextView.


ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
        android.R.layout.simple_list_item_1, myStringArray);

where android.R.layout.simple_list_item_1 is the layout that contains a TextView for each string in the array.

Then simply call setAdapter() on your ListView:

ListView listView = (ListView) findViewById(;

To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override getView(int, View, ViewGroup) to return the type of view you want. Check this example.