setRoleDescription

open fun setRoleDescription(@Nullable roleDescription: CharSequence)(source)

Sets the custom role description.

The role description allows you to customize the name for the view's semantic role. For example, if you create a custom subclass of android.view.View to display a menu bar, you could assign it the role description of "menu bar".

Warning: For consistency with other applications, you should not use the role description to force accessibility services to describe standard views (such as buttons or checkboxes) using specific wording. For example, you should not set a role description of "check box" or "tick box" for a standard android.widget.CheckBox. Instead let accessibility services decide what feedback to provide.

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

Parameters

roleDescription

The role description.