Code example for RadioButton

Methods: getText, getId

0
							displayToast(_radiobutton1.getText().toString());
						} 
						if (checkedId == _radiobutton2.getId()) {
							displayToast(_radiobutton2.getText().toString());
						} 
						if (checkedId == _radiobutton3.getId()) {
							displayToast(_radiobutton3.getText().toString());
						} 
						if (checkedId == _radiobutton4.getId()) {
							displayToast(_radiobutton4.getText().toString());
						} 
					} 
				}); 
	} 
 
	public void displayToast(String str) {
		Toast toast = Toast.makeText(this, "您选择了" + str, Toast.LENGTH_LONG);
		toast.setGravity(Gravity.TOP, 0, 300);
		toast.show();
	} 
}