FileDocCategorySizeDatePackage
ListWithHeaders.javaAPI DocAndroid 5.1 API1754Thu Mar 12 22:22:12 GMT 2015android.widget.listview

ListWithHeaders

public class ListWithHeaders extends android.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);