Miro Markaravanes
Miro Markaravanes

Reputation: 3366

Manipulating a group view in a ExpandableListView from the child view

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:

Screenshot 1

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

Answers (1)

j__m
j__m

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

Related Questions