compat/src/main/java/androidx/core/view/ViewCompat.java
public static boolean hasAccessibilityDelegate(@NonNull View v) {
        if (sAccessibilityDelegateCheckFailed) {
            return false; // View implementation might have changed.
        }
        if (sAccessibilityDelegateField == null) {
            try {
                sAccessibilityDelegateField = View.class
                        .getDeclaredField("mAccessibilityDelegate");
                sAccessibilityDelegateField.setAccessible(true);
            } catch (Throwable t) {
                sAccessibilityDelegateCheckFailed = true;
                return false;
            }
        }
        try {
            return sAccessibilityDelegateField.get(v) != null;
        } catch (Throwable t) {
            sAccessibilityDelegateCheckFailed = true;
            return false;
        }
    }
/**
     * Checks whether provided View has an accessibility delegate attached to it.
     *
     * @param v The View instance to check
     * @return True if the View has an accessibility delegate
     */
Checks whether provided View has an accessibility delegate attached to it.
@param v The View instance to check
@return True if the View has an accessibility delegate
Checks whether provided View has an accessibility delegate attached to it . @param v The View instance to check @return True if the View has an accessibility delegate
public static boolean hasAccessibilityDelegate(@NonNull View v) {
        if (sAccessibilityDelegateCheckFailed) {
            return false; 
        }
        if (sAccessibilityDelegateField == null) {
            try {
                sAccessibilityDelegateField = View.class
                        .getDeclaredField("mAccessibilityDelegate");
                sAccessibilityDelegateField.setAccessible(true);
            } catch (Throwable t) {
                sAccessibilityDelegateCheckFailed = true;
                return false;
            }
        }
        try {
            return sAccessibilityDelegateField.get(v) != null;
        } catch (Throwable t) {
            sAccessibilityDelegateCheckFailed = true;
            return false;
        }
    }
public static boolean hasAccessibilityDelegate ( @ NonNull View v ) { if ( sAccessibilityDelegateCheckFailed ) { return false ; } if ( sAccessibilityDelegateField == null ) { try { sAccessibilityDelegateField = View . class . getDeclaredField ( "mAccessibilityDelegate" ) ; sAccessibilityDelegateField . setAccessible ( true ) ; } catch ( Throwable t ) { sAccessibilityDelegateCheckFailed = true ; return false ; } } try { return sAccessibilityDelegateField . get ( v ) != null ; } catch ( Throwable t ) { sAccessibilityDelegateCheckFailed = true ; return false ; } }
Checks whether provided View has an accessibility delegate attached to it.
Checks whether provided View has an accessibility delegate attached to it .
// View implementation might have changed.