Code example for RadioButton

Methods: setOnCheckedChangeListener

0
		} 
		return false; 
	} 
	 
	private void setOnCheckedChangeListener(RadioButton r, final String s) {
		r.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				if (isChecked) {
					Log.i("HAWApp", "StudentOderProfWaehlen -> " + s + " gecheckt");
				} else { 
					Log.i("HAWApp", "StudentOderProfWaehlen -> " + s + " entcheckt");
				} 
			} 
		}); 
	} 
	 
	private void initView(){ 
		//set Orientation to portrait mode 
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
 
		studentRadioButton  = (RadioButton) findViewById(R.id.StudentRadioButton);