Share via


AccessibilityNodeInfo.SetParent Method

Definition

Overloads

SetParent(View)

Sets the parent.

SetParent(View, Int32)

Sets the parent to be a virtual descendant of the given root.

SetParent(View)

Sets the parent.

[Android.Runtime.Register("setParent", "(Landroid/view/View;)V", "GetSetParent_Landroid_view_View_Handler")]
public virtual void SetParent (Android.Views.View? parent);
[<Android.Runtime.Register("setParent", "(Landroid/view/View;)V", "GetSetParent_Landroid_view_View_Handler")>]
abstract member SetParent : Android.Views.View -> unit
override this.SetParent : Android.Views.View -> unit

Parameters

parent
View

The parent.

Attributes

Exceptions

If called from an AccessibilityService.

Remarks

Sets the parent.

<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.setParent(android.view.View).

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

SetParent(View, Int32)

Sets the parent to be a virtual descendant of the given root.

[Android.Runtime.Register("setParent", "(Landroid/view/View;I)V", "GetSetParent_Landroid_view_View_IHandler")]
public virtual void SetParent (Android.Views.View? root, int virtualDescendantId);
[<Android.Runtime.Register("setParent", "(Landroid/view/View;I)V", "GetSetParent_Landroid_view_View_IHandler")>]
abstract member SetParent : Android.Views.View * int -> unit
override this.SetParent : Android.Views.View * int -> unit

Parameters

root
View

The root of the virtual subtree.

virtualDescendantId
Int32

The id of the virtual descendant.

Attributes

Remarks

Sets the parent to be a virtual descendant of the given root. If virtualDescendantId equals to View#NO_ID the root is set as the parent.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

<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.setParent(android.view.View, int).

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