I would like to have the listview in a ListActivity be displayed with the header and footer visible all the time even if the list data is empty.
An empty list causes the empty view to appear and the header and footer to disappear. However my header has filtering UI and should therefore always be visible.
The only way I can make it happen at the moment is if I take the header and footer out of the listview and implement them as static views outside in the activity layout. However then these are always visible and only the data scrolls.
I would prefer for both to just be on top and bottom of the scrolling list. Wrapping it all in a scroll view does not work since then there are two nested scroll views( the list view outside and the wrapping one).
Is there a way to do this nicely apart from a hack like adding a fake record?
GONE
and set yourListView
visible. See this answer: stackoverflow.com/questions/4798387/… – Lorenzo Polidori