Code example for RadioGroup

Methods: findViewByIdgetChildAtgetChildCountgetCheckedRadioButtonId

0
	private String getSelectedWebAddress(){
 
		String res = null;
 
		// let see if custom being checked 
		int count = mRadioGroup.getChildCount();
		RadioButton rbCustom = (RadioButton)mRadioGroup.getChildAt(count - 1);
 
		int radioButtonID = mRadioGroup.getCheckedRadioButtonId();
 
		if(rbCustom.isChecked()) 
			res = mCustom.getText().toString();
		else 
			res = ((RadioButton)mRadioGroup.findViewById(radioButtonID)).getText().toString();
 
		DH.showDebugInfo("selectedWebAddress:id=" + radioButtonID+ ",res=" + res);
		return res;
	} 
 
	public void onSaveSelectionButtonClick(View view){
Stop searching for code, let great code find you!  Add Codota to your java IDE