Interactive Role Undefined
Interactive Android elements must expose a meaningful accessibility role so TalkBack can announce what the element is and how to interact with it.
WCAG Reference
Maps to: WCAG 4.1.2 Name, Role, Value | Applies to: WCAG 2.0, WCAG 2.1, WCAG 2.2 Introduced in: WCAG 2.0 | Level: A | Read the official specification →
What this rule checks
The scanner flags interactive elements (buttons, switches, checkboxes, sliders) that do not expose a recognized accessibility role to the Android accessibility framework.
Why it matters
TalkBack announces both the accessible name and the role ("Button", "Switch", "Checkbox") to tell users what kind of control they are interacting with. Without a role, users hear the name but cannot tell whether to tap, swipe, or double-tap.
Common failure patterns
- custom clickable
Viewelements with noaccessibilityClassNameoverride LinearLayoutorFrameLayoutused as a button with anonClickListenerbut no role- Jetpack Compose elements using
clickablewithout aroleparameter inModifier.semantics
Remediation guidance
- use native Android widgets (
Button,Switch,CheckBox) whenever possible - for custom views, override
getAccessibilityClassName()to return the appropriate widget class name - in Jetpack Compose, set
role = Role.Button(or the appropriate role) insideModifier.semantics { } - test with TalkBack to confirm the announced role matches the element's behavior
