Missing Label for Input Fields

Id MissingLabelforInputFields
Summary Input fields lack any label describing their purpose or expected input
Severity Warning
Category Assistive Technologies / Labels and Associations
Affects Resource files and Kotlin and Java files
Implementation Custom lint rule with limitations - detect missing android:label in manifest for activities. Manual testing required for programmatic title setting in Kotlin/Java code (e.g., setTitle() calls for activities and fragments).

Symptom

Activities or Fragments lack proper android:label attributes (set via setTitle() or in the manifest) that Screen Readers can announce as screen titles when navigating.

Rationale

Prevents screen reader users from understanding their current location within the app, making navigation confusing and reducing their ability to orient themselves and understand the app's structure.

Examples

XML Layout Example

<!-- Activity missing android:label attribute -->
<activity
    android:name=".MainActivity"
    android:exported="true" />

Kotlin Code Example

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Missing: setTitle() or supportActionBar?.title
        // Screen reader users won't know this is the main screen
    }
}

GitHub issues under this tag