Android examples for User Interface:RadioButton
get Radio Selected Index
import android.widget.RadioGroup; public class Main { public static int getRadioSelectedIndex(RadioGroup radioGroup) { int checkedRadioButtonId = radioGroup.getCheckedRadioButtonId(); if (checkedRadioButtonId <= 0) { return -1;//w w w . j a v a 2 s .c o m } return radioGroup.indexOfChild(radioGroup .findViewById(checkedRadioButtonId)); } }