Udostępnij za pośrednictwem


AccessibilityManager.IsEnabled Property

Definition

Returns if the accessibility in the system is enabled.

public bool IsEnabled { [Android.Runtime.Register("isEnabled", "()Z", "")] get; }
[<get: Android.Runtime.Register("isEnabled", "()Z", "")>]
member this.IsEnabled : bool

Property Value

True if accessibility is enabled, false otherwise.

Attributes

Remarks

Returns if the accessibility in the system is enabled.

<b>Note:</b> This query is used for sending AccessibilityEvents, since events are only needed if accessibility is on. Avoid changing UI or app behavior based on the state of accessibility. While well-intentioned, doing this creates brittle, less well-maintained code that works for some users but not others. Shared code leads to more equitable experiences and less technical debt.

For example, if you want to expose a unique interaction with your app, use ViewCompat#addAccessibilityAction in AndroidX to make this interaction - ideally with the same code path used for non-accessibility users - available to accessibility services. Services can then expose this action in the way best fit for their users.

Java documentation for android.view.accessibility.AccessibilityManager.isEnabled().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to