Android Lists

This video, part of my Android Quick Code Access series of posts, explains Android Lists. It's from my course Learning Android App Programming.

The Java source code for this example is shown below...

// Copyright (C) 2007 The Android Open Source Project.


import android.os.Bundle;
import android.widget.ArrayAdapter;

 * A list view example where the 
 * data for the list comes from an array of strings.
public class List1 extends ListActivity {

    // onCreate method executed when the ListActivity is started.
    public void onCreate(Bundle savedInstanceState) {

        // Use an existing ListAdapter that will map an array
        // of strings to TextViews
        setListAdapter(new ArrayAdapter(this,
    // String array containing items to be displayed.
    private String[] mStrings = Cheeses.sCheeseStrings;

For list item layout options (like android.R.layout.simple_list_item_1 used in the sample above), see the R.layout class.