Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble adding footer to ListView

I have a ListView that I'm trying to add a footer to. For some reason, it won't show up. My footer is defined in a separate XML layout called layout_footer.

View v = getLayoutInflater().inflate(R.layout.layout_footer, getListView(), false);
getListView().addFooterView(v);

Here is the code in my ListActivity's onCreate method. Please note that it is the last thing I do in onCreate.

I want this item to scroll with the rest of the list and, according to the resources I've found, I believe this is how you do it. Unfortunately, the footer does not show :(

Help would be much appreciated

like image 392
Andrew Avatar asked Aug 05 '10 18:08

Andrew


1 Answers

Apparently if I add the footer before setting the Adapter, it works

like image 54
Andrew Avatar answered Sep 19 '22 01:09

Andrew