What is the best way of displaying error messages to the user?
Assume the following scenario (just for example, this question relates to common problem, when error may occur in service, in the thread etc.):
How to show the error? Possible solutions:
What is your experience? How do you show user errors? Is there some guides explaining what is the best way?
In order to display error messages on forms, you need to consider the following four basic rules: The error message needs to be short and meaningful. The placement of the message needs to be associated with the field. The message style needs to be separated from the style of the field labels and instructions.
Summary: Established wisdom holds that good error messages are polite, precise, and constructive. The Web brings a few new guidelines: Make error messages clearly visible, reduce the work required to fix the problem, and educate users along the way.
Error messages should be in the format of what is and what can or cannot be done. Use a period in error message text, even if there is only one sentence. If there are multiple sentences, use only one space after the periods, not two.
I have used the alertDialog.. refer the Images. futher google it
For user Attention.
for form Validation edit texts use editText.setError("Your error message")
method
for internet connection failed
for internent connection failed with retry.
Update 1
For showing some auto terminate info/message we use Toast
for example notifying a user that your Email was sent Successfully.
We can Use Toast like below
Toast.makeText(context, "Email was sent Successfully.", duration).show()
Note: User can't interact with Default toast, See also Custom Toast Layout
Another option is to use the new Snackbar
Hope this will be helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With