Code example for RadioButton

Methods: getId, isChecked

0
			Log.d(TAG, "child : " + child.getClass().getName() + ", index : " + index);
		 
		if(child instanceof RadioButton) {				
			final RadioButton button = (RadioButton) child;
					 
			if (button.isChecked()) {
				mProtectFromCheckedChange = true;
				if (mCheckedId != -1) {
					setCheckedStateForView(mCheckedId, false);
				} 
				mProtectFromCheckedChange = false;
				setCheckedId(button.getId());
			} 
		} 
		super.addView(child, index, params);
	} 
	 
	public void check(int id) {
		if(DEBUG)
			Log.d(TAG, "check : id = " + id);