Code example for AccessibilityEvent

Methods: setChecked

0
 
  @Override 
  public boolean dispatchPopulateAccessibilityEvent(final AccessibilityEvent event) {
      boolean populated = super.dispatchPopulateAccessibilityEvent(event);
      if (!populated) {
          event.setChecked(checked);
      } 
      return populated;
  } 
 
  @Override 
  protected int[] onCreateDrawableState(final int extraSpace) {
    final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
    if (checked) {
      mergeDrawableStates(drawableState, CHECKED_STATE_SET);
    } 
    return drawableState;
  } 
 
  public boolean isEllipsized() { return isEllipsized; }