Reputation: 3366
I'm building an ExpandableListView
in which there are groups of radio buttons.
Currently, I am able to handle the click event on each radio button and select the corresponding one and deselect the others. But there is just one more thing needed to make it perfect. That is displaying the value of the selected checkbox in the group view so the user can see what is selected without expanding it.
For that purpose, I have a TextView
in the group view. Is it possible to update that TextView
when a checkbox is selected in the child view?
Here is a screenshot of what I have right now:
Basically what I want to accomplish is to make it write the value of the selected checkbox instead of "Regular".
Thanks.
Upvotes: 0
Views: 1108
Reputation: 9645
in your example, it seems perfectly reasonable to save a reference to your TextView
inside a member variable when it is created. you can then easily update its value by calling setText()
on it from within your checkbox's click handler.
it is neither necessary nor desirable to call notifyDataSetChanged()
.
Upvotes: 1