I do not think that it is possible to add a footer to an empty ListView . Although the ListView can use an empty View , which can be displayed when there are no items in the ListView . There are now two ways to do this:
1
RelativeLayout empty = (RelativeLayout) getLayoutInflater().inflate( R.layout.empty_view, null); ((ViewGroup)list.getParent()).addView(empty); list.setAdapter(adapter);
2
RelativeLayout empty = (RelativeLayout) getLayoutInflater().inflate( R.layout.empty_view, (ViewGroup) list.getParent()); list.setEmptyView(empty);
here empty is of type View , so it can be LinearLayout or RelativeLayout , which can be inflated using LayoutInflater at run time.
NOTE. make sure you install the adapter after adding an empty view.
Hope this helps.
source share