Code example for CheckBox

Methods: isCheckedsetChecked

0
public class CompoundButtonListenersTest 
{ 
	@Test 
	public void shouldSupportMultipleOnCheckedChangeListeners() 
	{ 
		CheckBox view = new CheckBox(null);
		CompoundButtonListeners viewListeners = new CompoundButtonListeners(view);
 
		MockOnCheckedChangeListener listener1 = new MockOnCheckedChangeListener();
		MockOnCheckedChangeListener listener2 = new MockOnCheckedChangeListener();
 
		viewListeners.addOnCheckedChangeListener(listener1);
		viewListeners.addOnCheckedChangeListener(listener2);
 
		view.setChecked(!view.isChecked());
 
		assertTrue(listener1.checkedChangeEventFired);
		assertTrue(listener2.checkedChangeEventFired);
	} 
 
Connect your IDE to all the code out there  Get Codota for Java