FileDocCategorySizeDatePackage
ListManagedCursor.javaAPI DocAndroid 1.5 API2218Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview

ListManagedCursor

public class ListManagedCursor extends android.app.ListActivity implements android.widget.AdapterView.OnItemClickListener

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

        super.onCreate(savedInstanceState);

        // Get a cursor with all people
        Cursor c = getContentResolver().query(Settings.System.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);
        getListView().setOnItemClickListener(this);
    
public voidonItemClick(android.widget.AdapterView parent, android.view.View view, int position, long id)

        Intent dummyIntent = new Intent(this, ListSimple.class);
        startActivity(dummyIntent);