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

ListWithHeaders

public class ListWithHeaders extends com.android.frameworktest.util.ListScenario

Fields Summary
Constructors Summary
Methods Summary
protected voidinit(Params params)

        params.setStackFromBottom(false)
                .setStartingSelectionPosition(-1)
                .setNumItems(24)
                .setItemScreenSizeFactor(0.14);
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        final ListView listView = getListView();
        listView.setItemsCanFocus(true);

        for (int i = 0; i < 12; i++) {
            Button header = new Button(this);
            header.setText("Header View");
            listView.addHeaderView(header);
        }

        for (int i = 0; i < 12; i++) {
            Button footer = new Button(this);
            footer.setText("Footer View");
            listView.addFooterView(footer);
        }

        final ListAdapter adapter = listView.getAdapter();
        listView.setAdapter(adapter);