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");