Code example for AccessibilityEvent

Methods: getText

0
            // We called the super implementation to populate its text to the 
            // event. Then we add our text not present in a super class. 
            // Very often you will need to add only the text on the custom view. 
            CharSequence text = getText();
            if (!TextUtils.isEmpty(text)) {
                event.getText().add(text);
            } 
        } 
    } 
 
    /** 
     * Demonstrates how to enhance the accessibility support via composition. 
     * <p> 
     * <strong>Note:</strong> Using composition ensures that your application is 
     * backwards compatible. The android-support-v4 library has API that allow 
     * using the accessibility APIs in a backwards compatible manner. 
     * </p> 
     */ 
    public static class AccessibleCompoundButtonComposition extends BaseToggleButton { 
 
        public AccessibleCompoundButtonComposition(Context context, AttributeSet attrs) {