Please see my answer to your other basically identical question , which I copied below ... :)
Recently, I had the same need - to have a radio group in which the selected item could be canceled by clicking on it again. I found that I was not able to accomplish this using listeners, but I was able to do this using a custom RadioButton , for example ...
public class ToggleableRadioButton extends RadioButton {
Notice that the button switches differently depending on its current state, i.e. it calls setChecked(true) on the button and calls clearCheck() in the group. If setChecked() used in both cases, the button that was simply canceled cannot be immediately re-selected - the logic in RadioGroup prevents it.
To use this button, simply replace the <RadioButton> tags with <your.package.ToggleableRadioButton> in your XML layout.
source share