Question

in an android application I have a RadioGroup with multiple RadioButtons in it.

I implemented the OnCheckedChangeListener to capture checked change.

But this does not get fired it you click on a radio button that is already checked.

Is there a way to force the OnCheckedChangeListener to be called even if the user clicks on a radio button that is allready checked?

I thought of using setOnClickListener or setOnTouchListener but how can I get which radio button has been tapped if I use them? THey don't have a checkedId or index to know.

Thanks for any help

Était-ce utile?

La solution

From your comments, you can set an OnClickListener on each RadioButton. However, without knowing exactly what you are trying to accomplish, I don't see this as a viable solution. Users expect a RadioButton to act in a certain way. You may want to consider changing the checked state of the RadioButton each time the user returns to this Activity.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top