Code example for RadioGroup

Methods: getChildAtgetChildCount

0
 
		mCustom = (EditText)findViewById(R.id.customWebAddress);
		mCustom.setOnFocusChangeListener(new OnFocusChangeListener(){
			public void onFocusChange(View v, boolean hasFocus){
				if (hasFocus){
					int count = mRadioGroup.getChildCount();
					((RadioButton)mRadioGroup.getChildAt(count-1)).setChecked(true);
				} 
			} 
		}); 
 
		int count = mRadioGroup.getChildCount();
		for(int i=0; i<count; i++){
			RadioButton rb = (RadioButton)mRadioGroup.getChildAt(i);
 
			// last idx is custom 
			if(i == count-1){
				rb.setChecked(true);
				mCustom.setText(GP.webServiceURI);				
				DH.showDebugInfo("setSelected:id=" + i);
				break;