I am trying to achieve something like this. The Expandable List consists of the names of certain categories and when a parent is clicked, it shows the list of all the children in that category. Now, suppose I want dynamically add a child to any category ? How do I do that ? Do I keep a button with every parent in the list clicking on which would add a new child under it ?
But looking around in different forums, I came to realize that it is not really easy to set a button click handler inside every parent. But if that is the only way, can anyone give me some sample code please ?
I found this thread but wasn't able to implement it in my code. Android Row becomes Unclickable with Button
Adding a button to the group view shouldn't be that difficult.
I believe the below should work (although I don't have a project using an array backed ExpandableListView to test on).
I don't know your group row layout, so I'll make one up here for reference purposes.
group_layout.xml
Then in your
getGroupView
method from your adapter: