Code example for AtomicBoolean

Methods: set

0
    ViewFinder finder = new ViewFinder(checkbox);
    final AtomicBoolean run = new AtomicBoolean(false);
    finder.onCheck(android.R.id.button1, new OnCheckedChangeListener() {
 
      public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        run.set(true);
      } 
    }); 
    checkbox.performClick();
    assertTrue(run.get());
  } 
}