Is it possible to set header and footer at ListActivity to be fixed at the top and the bottom, so only the content (list) is scrolling, not also header and footer?
I have both set like this:
View header = getLayoutInflater().inflate(R.layout.list_header, null);
View footer = getLayoutInflater().inflate(R.layout.list_footer, null);
ListView listView = getListView();
listView.addHeaderView(header);
listView.addFooterView(footer);
You can achieve it by using a custom XML layout in which you will set the layout of your header, footer and list.
Note that to be compatible with
ListActivitythis layout must contain aListViewwith the idandroid.R.id.list:And set it in your
ListActivitylike this: