Missing inputType
Missing inputType
Providing an inputType
attribute on a text field improves usability because depending on the data to be input, optimized keyboards can be shown to the user (such as just digits and parentheses for a phone number).
The lint detector also looks at the id
of the view, and if the id offers a hint of the purpose of the field (for example, the id
contains the phrase phone
or email
), then lint will also ensure that the inputType
contains the corresponding type attributes.
If you really want to keep the text field generic, you can suppress this warning by setting inputType="text"
.
Issue id: TextFields
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3 |
Plugin: | Android, 2022.3.1 Beta 2 |
Last modified: 13 July 2023