Answers for "set selected radio button android"

0

android studio get selected radio button

int radioButtonID = radioButtonGroup.getCheckedRadioButtonId();
View radioButton = radioButtonGroup.findViewById(radioButtonID);
int idx = radioButtonGroup.indexOfChild(radioButton);
Posted by: Guest on October-09-2021
0

how to set radio button checked in android programmatically

In your layout you can add android:checked="true" to CheckBox you want to be selected.

Or programmatically, you can use the setChecked method defined in the checkable interface:

RadioButton b = (RadioButton) findViewById(R.id.option1);
b.setChecked(true);
Posted by: Guest on March-19-2021

Code answers related to "set selected radio button android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language