I have managed to add a button to the bottom of my ListView using:
Button button = new Button(getApplicationContext());
button.setText(R.string.export);
button.setOnClickListener(this);
getListView().addFooterView(button);
However, I am not quite able to figure out how to access my ListView or the ListActivity that is the parent here (to get the number of items in my adapter). My main class is a ListActivity and is defined as:
public class Main extends ListActivity implements OnClickListener{
}
I haven’t tried doing getRootView() and then looking up the ListView from there because I figure there must be an easy way to do this, I’m just missing it.
getListView()method. The same method you use to add button.