I have an app that uses radio buttons. The default for this button is set in the main.xml file, ie:
In the Java file I have:
final RadioButton radio1 = (RadioButton)findViewById(R.id.rb_sat1E);
I have also created a 'Reset' button in the main Java file and can use the following code to reset TextView information ie.
But how do I reset a radio button? I would have thought it to be something like
But that does not work at all.
Any help greatly appreciated. Thanks.
For radioButton use
It does not make sense to have just one RadioButton. If you have more of them you need to uncheck others through
If your setting is just on/off use CheckBox.
If you want to do it in code, you can call the check member of RadioGroup:
This will check the button you specify and uncheck the others.