FileDocCategorySizeDatePackage
List2.javaAPI DocGoogle Android v1.5 Example1747Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.view

List2

public class List2 extends android.app.ListActivity
A list view example where the data comes from a cursor.

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        // Get a cursor with all people
        Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);
        startManagingCursor(c);

        ListAdapter adapter = new SimpleCursorAdapter(this, 
                // Use a template that displays a text view
                android.R.layout.simple_list_item_1, 
                // Give the cursor to the list adatper
                c, 
                // Map the NAME column in the people database to...
                new String[] {People.NAME} ,
                // The "text1" view defined in the XML template
                new int[] {android.R.id.text1}); 
        setListAdapter(adapter);