FileDocCategorySizeDatePackage
ListWithFooterViewAndNewLabels.javaAPI DocAndroid 1.5 API3300Wed May 06 22:42:02 BST 2009com.android.frameworktest.focus

ListWithFooterViewAndNewLabels

public class ListWithFooterViewAndNewLabels extends android.app.ListActivity

Fields Summary
private MyAdapter
mMyAdapter
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.list_with_button_above);

        Button footerButton = new Button(this);
        footerButton.setText("hi");
        footerButton.setLayoutParams(
                new AbsListView.LayoutParams(
                        ViewGroup.LayoutParams.WRAP_CONTENT,
                        ViewGroup.LayoutParams.WRAP_CONTENT));
        getListView().addFooterView(footerButton);

        mMyAdapter = new MyAdapter(this);
        setListAdapter(mMyAdapter);

        // not in list
        Button topButton = (Button) findViewById(R.id.button);
        topButton.setText("click to add new item");
        topButton.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                mMyAdapter.addLabel("yo");
            }
        });

        mMyAdapter.addLabel("first");