Java tutorial
//package com.java2s; import android.util.Log; import android.widget.RadioButton; public class Main { /** * * @param args * @param val * @param rb */ public static void setSelectedRadioButton(String args, String[] val, RadioButton[] rb) { try { if (val.length == rb.length) { for (int i = 0; i < val.length; i++) { if (args.equalsIgnoreCase(val[i])) { rb[i].setChecked(true); } } } } catch (Exception e) { Log.e("ZambelzUtility", "setSelectedRadioButton : " + e.getMessage()); } } }