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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top