RadioGroup
in the codeRadioGroup radioGroup = new RadioGroup(this);
RadioButton radioBtn1 = new RadioButton(this);
RadioButton radioBtn2 = new RadioButton(this);
RadioButton radioBtn3 = new RadioButton(this);
radioBtn1.setText("hoge");
radioBtn2.setText("huga");
radioBtn3.setText("piyo");
radioGroup.addView(radioBtn1);
radioGroup.addView(radioBtn2);
radioGroup.addView(radioBtn3);
//Without this one line, the check will not move even if the others are in the checked state
radioGroup.check(radioBtn1.getId());
Recommended Posts