FileDocCategorySizeDatePackage
ListManagedCursor.javaAPI DocAndroid 5.1 API2207Thu Mar 12 22:22:12 GMT 2015android.widget.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);