removeLabeledBy

open fun removeLabeledBy(@NonNull label: @NonNull View): Boolean(source)

Removes a label. If the label was not previously added to the node, calling this method has no effect.

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

Note: If the Android version is less than 36, this method has no effect; call setLabeledBy with null to remove the current label.

Return

true if the label was present

Parameters

label

The node which serves as this node's label.

See also


open fun removeLabeledBy(@NonNull root: @NonNull View, virtualDescendantId: Int): Boolean(source)

Removes a label which is a virtual descendant of the given root. If virtualDescendantId is NO_ID the root is set as the label. If the label was not previously added to the node, calling this method has no effect.

Note: If the Android version is less than 36, this method has no effect; call setLabeledBy with null to remove the current label.

Return

true if the label was present

Parameters

root

The root of the virtual subtree.

virtualDescendantId

The id of the virtual node which serves as this node's label.

See also