Unlabeled Toggle Control
Android toggle controls (switches, toggle buttons) must have labels that describe what setting they control.
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 Switch, ToggleButton, and SwitchCompat elements that have no accessible label, leaving TalkBack to announce only the state ("On" / "Off") without context.
Why it matters
Hearing "Switch, off" without knowing what the switch controls is useless. TalkBack users need both the label and the state to understand the setting and decide whether to change it.
Common failure patterns
Switchelements with noandroid:textand nocontentDescription- toggle controls where the label is a separate
TextViewnot programmatically linked - custom toggle implementations that do not expose accessibility text
Remediation guidance
- set
android:texton the toggle control to describe the setting - if the label is a separate view, use
android:labelForon the label pointing to the toggle - for Jetpack Compose, set a description in
Modifier.semantics { contentDescription = "..." } - test with TalkBack to confirm the full announcement includes both the label and the state
