FileDocCategorySizeDatePackage
ExpandableList2.javaAPI DocAndroid 1.5 API3447Wed May 06 22:41:08 BST 2009com.example.android.apis.view

ExpandableList2

public class ExpandableList2 extends android.app.ExpandableListActivity
Demonstrates expandable lists backed by Cursors

Fields Summary
private int
mGroupIdColumnIndex
private String[]
mPhoneNumberProjection
private android.widget.ExpandableListAdapter
mAdapter
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

    

    
        
        super.onCreate(savedInstanceState);

        // Query for people
        Cursor groupCursor = managedQuery(People.CONTENT_URI,
                new String[] {People._ID, People.NAME}, null, null, null);

        // Cache the ID column index
        mGroupIdColumnIndex = groupCursor.getColumnIndexOrThrow(People._ID);

        // Set up our adapter
        mAdapter = new MyExpandableListAdapter(groupCursor,
                this,
                android.R.layout.simple_expandable_list_item_1,
                android.R.layout.simple_expandable_list_item_1,
                new String[] {People.NAME}, // Name for group layouts
                new int[] {android.R.id.text1},
                new String[] {People.NUMBER}, // Number for child layouts
                new int[] {android.R.id.text1});
        setListAdapter(mAdapter);