Code example for CompoundButton

Methods: getContext

0
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
				 
				@Override 
				public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
					Toast.makeText(buttonView.getContext(), "Checked", 5);
				} 
			}); 
		} 
		return super.getView(position, convertView, parent);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE