Share via


AccessibilityNodeInfo.FindAccessibilityNodeInfosByViewId(String) Method

Definition

Finds AccessibilityNodeInfos by the fully qualified view id's resource name where a fully qualified id is of the from "package:id/id_resource_name".

[Android.Runtime.Register("findAccessibilityNodeInfosByViewId", "(Ljava/lang/String;)Ljava/util/List;", "GetFindAccessibilityNodeInfosByViewId_Ljava_lang_String_Handler")]
public virtual System.Collections.Generic.IList<Android.Views.Accessibility.AccessibilityNodeInfo>? FindAccessibilityNodeInfosByViewId (string viewId);
[<Android.Runtime.Register("findAccessibilityNodeInfosByViewId", "(Ljava/lang/String;)Ljava/util/List;", "GetFindAccessibilityNodeInfosByViewId_Ljava_lang_String_Handler")>]
abstract member FindAccessibilityNodeInfosByViewId : string -> System.Collections.Generic.IList<Android.Views.Accessibility.AccessibilityNodeInfo>
override this.FindAccessibilityNodeInfosByViewId : string -> System.Collections.Generic.IList<Android.Views.Accessibility.AccessibilityNodeInfo>

Parameters

viewId
String

The fully qualified resource name of the view id to find.

Returns

A list of node info.

Attributes

Remarks

Finds AccessibilityNodeInfos by the fully qualified view id's resource name where a fully qualified id is of the from "package:id/id_resource_name". For example, if the target application's package is "foo.bar" and the id resource name is "baz", the fully qualified resource id is "foo.bar:id/baz".

<strong>Note:</strong> The primary usage of this API is for UI test automation and in order to report the fully qualified view id if an AccessibilityNodeInfo the client has to set the AccessibilityServiceInfo#FLAG_REPORT_VIEW_IDS flag when configuring the android.accessibilityservice.AccessibilityService.

<strong>Note:</strong> If this view hierarchy has a SurfaceView embedding another view hierarchy via SurfaceView#setChildSurfacePackage, there is a limitation that this API won't be able to find the node for the view on the embedded view hierarchy. It's because views don't know about the embedded hierarchies. Instead, you could traverse all the children to find the node.

Java documentation for android.view.accessibility.AccessibilityNodeInfo.findAccessibilityNodeInfosByViewId(java.lang.String).

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