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 even ExpandableListView.addFooterView()
for that matter. The method you are calling is the inherited ListView.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 ExpandableListAdapter
implementation so that getChildrenCount()
returns the data set size + 1, and then return the footer view in getChildView()
for the appropriate position. Also, getChildView()
provides a boolean parameter to flag when it is retrieving the last child in any specific group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With