addLabeledBy
Adds the view which serves as the label of the view represented by this info for accessibility purposes. When multiple labels are added, the content from each label is combined in the order that they are added.
If visible text can be used to describe or give meaning to this UI, this method is preferred. For example, a TextView before an EditText in the UI usually specifies what information is contained in the EditText. Hence, the EditText is labeled by the TextView.
Parameters
A view that labels this node's source.
Adds the view which serves as the label of the view represented by this info for accessibility purposes. If virtualDescendantId
is NO_ID the root is set as the label.
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 themselves as a tree of virtual views, thus conveying their logical structure.
If visible text can be used to describe or give meaning to this UI, this method is preferred. For example, a TextView before an EditText in the UI usually specifies what information is contained in the EditText. Hence, the EditText is labeled by the TextView.
Note: Cannot be called from an android.accessibilityservice.AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.
Note: Starting with Android 36, when multiple labels are added, the content from each label is combined in the order that they are added. Before Android 36, the most recently added label is set as the only label.
Parameters
A root whose virtual descendant labels this node's source.
The id of the virtual descendant.