In Android ListActivity, how do you apply layout formatting to footers?
- by johnrock
In an Android ListActivity, I am adding a button as a footer in a ListView. How can I apply layout formatting to this button like centering it and/or width=fill_parent?
I have tried a few things such as using setLayoutParams(), but have not gotten it to work - the footer always disappears when I try anything.
Here is the basic code I am working with
closeButton = new Button(this);
closeButton.setText(getResources().getString(R.string.title_closeprocess));
closeButton.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
closeProcess();
}
});
getListView().addFooterView(closeButton);