Język

ContentCaptureSession.NotifyNodeAppearedOrChanged Method

Definition

Creates a new node or updates an existing one according to the changes in properties.

[Android.Runtime.Register("notifyNodeAppearedOrChanged", "(Landroid/view/autofill/AutofillId;Landroid/view/contentcapture/ContentCaptureNodeProperties;)V", "GetNotifyNodeAppearedOrChanged_Landroid_view_autofill_AutofillId_Landroid_view_contentcapture_ContentCaptureNodeProperties_Handler", ApiSince=37)]
public abstract void NotifyNodeAppearedOrChanged(Android.Views.Autofill.AutofillId id, Android.Views.ContentCaptures.ContentCaptureNodeProperties? properties);
[<Android.Runtime.Register("notifyNodeAppearedOrChanged", "(Landroid/view/autofill/AutofillId;Landroid/view/contentcapture/ContentCaptureNodeProperties;)V", "GetNotifyNodeAppearedOrChanged_Landroid_view_autofill_AutofillId_Landroid_view_contentcapture_ContentCaptureNodeProperties_Handler", ApiSince=37)>]
abstract member NotifyNodeAppearedOrChanged : Android.Views.Autofill.AutofillId * Android.Views.ContentCaptures.ContentCaptureNodeProperties -> unit

Parameters

id
AutofillId

The AutofillId of the node.

properties
ContentCaptureNodeProperties

The ContentCaptureNodeProperties holding the attributes for this node.

Attributes

Remarks

Creates a new node or updates an existing one according to the changes in properties.

This is the primary method to construct and report the UI hierarchy in Content Capture Version 2. It unifies the reporting of both standard Views and virtual views (e.g., inside a Webview) into a single, cohesive API. Call this method when a node is attached, laid out, and ready to be drawn in the active UI hierarchy, or when its properties (like text or bounds) change.

For standard views, the id can be obtained via View.getAutofillId(). For virtual views, the id must be created using newAutofillId(AutofillId,long).

To minimize memory allocations, applications should reuse a single ContentCaptureNodeProperties instance, calling ContentCaptureNodeProperties.clear() before populating it for a new node.

If the node already exists, only the properties explicitly set in the ContentCaptureNodeProperties payload will be updated. The parent-child relationship is modified based on the parent ID configuration: Setting parent ID to null: Guarantees that this node is treated as a root node with no parent; Not setting parent ID at all: Leaves the existing parent unchanged. If the node is appearing for the first time, it defaults to a root node.

Note: This function belongs to Content Capture Version 2.

Call this method on the thread that created the UI element. This is usually the application's main thread.

Android reference for android.view.contentcapture.ContentCaptureSession.notifyNodeAppearedOrChanged.

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