View.AnnounceForAccessibility Method

Definition

Overloads

AnnounceForAccessibility(ICharSequence)

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

AnnounceForAccessibility(String)

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

AnnounceForAccessibility(ICharSequence)

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

[Android.Runtime.Register("announceForAccessibility", "(Ljava/lang/CharSequence;)V", "GetAnnounceForAccessibility_Ljava_lang_CharSequence_Handler")]
public virtual void AnnounceForAccessibility (Java.Lang.ICharSequence? text);
[<Android.Runtime.Register("announceForAccessibility", "(Ljava/lang/CharSequence;)V", "GetAnnounceForAccessibility_Ljava_lang_CharSequence_Handler")>]
abstract member AnnounceForAccessibility : Java.Lang.ICharSequence -> unit
override this.AnnounceForAccessibility : Java.Lang.ICharSequence -> unit

Parameters

text
ICharSequence

The announcement text.

Attributes

Remarks

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

Note: The event generated with this API carries no semantic meaning, and is appropriate only in exceptional situations. Apps can generally achieve correct behavior for accessibility by accurately supplying the semantics of their UI. They should not need to specify what exactly is announced to users.

In general, only announce transitions and don’t generate a confirmation message for simple actions like a button press. Label your controls concisely and precisely instead, and for significant UI changes like window changes, use android.app.Activity#setTitle(CharSequence) and View#setAccessibilityPaneTitle(CharSequence).

Use View#setAccessibilityLiveRegion(int) to inform the user of changes to critical views within the user interface. These should still be used sparingly as they may generate announcements every time a View is updated.

Java documentation for android.view.View.announceForAccessibility(java.lang.CharSequence).

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

AnnounceForAccessibility(String)

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

public void AnnounceForAccessibility (string? text);
member this.AnnounceForAccessibility : string -> unit

Parameters

text
String

The announcement text.

Remarks

Convenience method for sending a AccessibilityEvent#TYPE_ANNOUNCEMENTAccessibilityEvent to suggest that an accessibility service announce the specified text to its users.

Note: The event generated with this API carries no semantic meaning, and is appropriate only in exceptional situations. Apps can generally achieve correct behavior for accessibility by accurately supplying the semantics of their UI. They should not need to specify what exactly is announced to users.

In general, only announce transitions and don’t generate a confirmation message for simple actions like a button press. Label your controls concisely and precisely instead, and for significant UI changes like window changes, use android.app.Activity#setTitle(CharSequence) and View#setAccessibilityPaneTitle(CharSequence).

Use View#setAccessibilityLiveRegion(int) to inform the user of changes to critical views within the user interface. These should still be used sparingly as they may generate announcements every time a View is updated.

Java documentation for android.view.View.announceForAccessibility(java.lang.CharSequence).

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