I have created a ListView
and added header with addHeaderView
, then I called setListAdapter
in my ListActivity
. Any idea how can I dynamically addFooterView
after I called setListAdapter
?
ANSWER: I added both header view and footer view (actually buttons) into my list view, but both of them I wrapped into a FrameLayout using wrap_content height, then when I do not need to be the header button to be shown I just setVisibility(View.GONE) and FrameLayout wraps to 0 height and vissualy it is not visible (same effect as if I would call removeHeaderView), and if I need to show it again I setVisibilty(View.VISIBLE) and it is shown (same effect as addHeaderView - which is of course not possible after calling setting list adapter)
Discussed here: Hide footer view in ListView?