Some, but not all, devices running Jelly Bean (4.2.1) appear to be missing the exclamation point error icon that should appear on a TextView
(or, more commonly, an EditText
) that has an error set on it via TextView.setError(CharSequence error)
.
The Galaxy Nexus definitely seems to be missing the icon.
The effect is that the error status set by setError
is only apparent when the EditText
has focus. This makes setError(...)
much less useful as it's often used to encourage users to return to that EditText
to fix a problem. E.g., you have a standard login screen with username and password form entries that are validated when the user clicks a submit button. A validation error message set on the username form won't display unless the user clicks back to that form -- which is what the error icon is designed to encourage them to do!
To test: (There may be a more readily accessible EditText, but this one is very widely available)
- Open Settings
- Select 'Add account' (this is in 'Accounts and Sync' on older devices)
- Select 'Google' as the account type
- Select 'Existing' (after clicking 'Next' and 'Sign in' on older devices)
- Leaving the 'Email'
EditText
blank, click on the 'Password'EditText
At this point, an error is set on the 'Email' EditText
saying that it can't be blank. On devices that don't have this problem, the usual error icon is shown, which expands to the full error message when the EditText
has focus. On Galaxy Nexuses running Jelly Bean, no icon is shown and the error is only visible at all when the 'Email' EditText
has focus again, and still lacks the icon at that point.
This looks like a bug, but I wanted to check if other people can reproduce it, have ideas about what the problem might be, and have a good workaround.
Using setError(CharSequence error, Drawable icon)
would probably fix things, but it'd be nice to be able to use the stock error graphic across different Android versions.