void sendAccessibilityEvent ( View view ) { // Since the view is still not attached we create, populate, // and send the event directly since we do not know when it // will be attached and posting commands is not as clean. AccessibilityManager accessibilityManager = ( AccessibilityManager ) getContext ( ) . getSystemService ( Context . ACCESSIBILITY_SERVICE ) ; if ( accessibilityManager == null ) return ; if ( mSendClickAccessibilityEvent && accessibilityManager . isEnabled ( ) ) { AccessibilityEvent event = AccessibilityEvent . obtain ( ) ; event . setEventType ( AccessibilityEvent . TYPE_VIEW_CLICKED ) ; view . onInitializeAccessibilityEvent ( event ) ; view . dispatchPopulateAccessibilityEvent ( event ) ; accessibilityManager . sendAccessibilityEvent ( event ) ; } mSendClickAccessibilityEvent = false ; }
As defined in TwoStatePreference source