Code example for CompoundButton

Methods: setOnCheckedChangeListener

0
	implements CompoundButton.OnCheckedChangeListener{
 
	@Override 
	public void registerToView(View v) {
		if (CompoundButton.class.isInstance(v)){
			((CompoundButton)v).setOnCheckedChangeListener(this);
		} 
	} 
 
	public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
		if (!this.isFromUser()){
			this.clearBroadcastState();
			return; 
		} 
		 
		for(OnCheckedChangeListener l: listeners){
			l.onCheckedChanged(arg0, arg1);
		} 
		this.clearBroadcastState();
	} 
}