Java tutorial
//package com.java2s; //License from project: Apache License import android.widget.RadioButton; import android.widget.RadioGroup; public class Main { public static void checkRadioGroup(RadioGroup radioGroup, String selectedRadioText) { for (int i = 0; i < radioGroup.getChildCount(); i++) { RadioButton radio = (RadioButton) radioGroup.getChildAt(i); if (radio.getText().equals(selectedRadioText)) { radioGroup.check(radio.getId()); break; } } } }