I’ve been attempting to work out how to add a child View to a child List in an ExpandableListActivity, but to no avail.
I can get the ExpandableListView and call addFooterView() on it, but that just adds the new View to the group list. (The data comes from a Cursor).
Any suggestions gratefully received.
Cheers
James
Unfortunately there is no
ExpandableListView.addChildFooterView()method, or evenExpandableListView.addFooterView()for that matter. The method you are calling is the inheritedListView.addFooterView(), which just adds the view as the last item in the entire list. It was not overridden for group/child behavior.The simplest way to do this is probably just to build something into your
ExpandableListAdapterimplementation so thatgetChildrenCount()returns the data set size + 1, and then return the footer view ingetChildView()for the appropriate position. Also,getChildView()provides a boolean parameter to flag when it is retrieving the last child in any specific group.