Share via


AccessibilityNodeInfo.TextFormatted Property

Definition

Gets the text of this node. -or- Sets the text of this node.

public virtual Java.Lang.ICharSequence? TextFormatted { [Android.Runtime.Register("getText", "()Ljava/lang/CharSequence;", "GetGetTextHandler")] get; [Android.Runtime.Register("setText", "(Ljava/lang/CharSequence;)V", "GetSetText_Ljava_lang_CharSequence_Handler")] set; }
[<get: Android.Runtime.Register("getText", "()Ljava/lang/CharSequence;", "GetGetTextHandler")>]
[<set: Android.Runtime.Register("setText", "(Ljava/lang/CharSequence;)V", "GetSetText_Ljava_lang_CharSequence_Handler")>]
member this.TextFormatted : Java.Lang.ICharSequence with get, set

Property Value

The text.

Attributes

Exceptions

If called from an AccessibilityService.

Remarks

Property getter documentation:

Gets the text of this node.

<strong>Note:</strong> If the text contains ClickableSpans or URLSpans, these spans will have been replaced with ones whose ClickableSpan#onClick(View) can be called from an AccessibilityService. When called from a service, the View argument is ignored and the corresponding span will be found on the view that this AccessibilityNodeInfo represents and called with that view as its argument.

This treatment of ClickableSpans means that the text returned from this method may different slightly one passed to #setText(CharSequence), although they will be equivalent according to TextUtils#equals(CharSequence, CharSequence). The ClickableSpan#onClick(View) of any spans, however, will generally not work outside of an accessibility service.

Java documentation for android.view.accessibility.AccessibilityNodeInfo.getText().

Property setter documentation:

Sets the text of this node.

<strong>Note:</strong> Cannot be called from an android.accessibilityservice.AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Java documentation for android.view.accessibility.AccessibilityNodeInfo.setText(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