You can take the RadioGroup identifier, which contains 3 radio buttons.
RadioGroup radiogrp = (RadioGroup) findViewById(R.id.RadioGroup);
int id = radiogrp.getCheckedRadioButtonId();
This will return the identifier of the selected switch in this group. If empty, the return value is -1.
So, you can set the if condition and check if the identifier == -1 is selected than no radio buttons.
source
share