Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncheck all RadioButton in a RadioButtonGroup

What I wanted to achieve is this: Right after the activity starts, I want that no RadioButton is selected/checked.

My problem is this: When the activity starts, the first RadioButton is always selected/checked.

I tried radioButton1.setChecked(false) right after initialization of the radiobutton(inside onCreate), but when the activity starts, I can't manually check/select the first radiobutton. Till I select the 2nd or 3rd radio button, I can now select/check the first radio button.

like image 247
Jayson Tamayo Avatar asked May 08 '12 11:05

Jayson Tamayo


People also ask

How do I uncheck all radio buttons?

If you want to uncheck all the radio buttons and checkboxes you will need to add one single line (in bold): $('#clear-all'). click(function () { $(':checkbox'). each(function () { $(this).

Can you uncheck radio buttons?

To set a radio button to checked/unchecked, select the element and set its checked property to true or false , e.g. myRadio. checked = true . When set to true , the radio button becomes checked and all other radio buttons with the same name attribute become unchecked.

Can you uncheck radio button Android?

You can't uncheck a checked RadioButton. The only way to uncheck is to select some other RadioButton belonging to that RadioGroup.


1 Answers

RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radiogroup); radioGroup.clearCheck(); 
like image 72
Samir Mangroliya Avatar answered Oct 11 '22 13:10

Samir Mangroliya