Reputation: 4557
I've got a ListView, which is fully defined in the xml file. Now I want to add a footer to thi s list so that the last element of the list became a button.
So firstly I do this: View v = getLayoutInflater().inflate(R.layout.add_new, null);
, where add_new is the layout for my footer
Now I know that I need to do smth like this:
listViewInstance.addFooterView(v);
But i dont really have that instance as my ListView is defined in an xml file. So what do I write instead of listViewInstance? Is there a way to get its instance somehow from an xml?
Thanks in advance xxx
Upvotes: 0
Views: 172
Reputation: 69208
Use ListActivity.getListView() if you are using a ListActivity or Activity.findViewById() to get the reference to the list view otherwise.
Upvotes: 1