Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice for displaying error messages

Tags:

android

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.):

  1. We load some data for some screen
  2. Error occurs (Internet is not available, server exception, other exceptions ...)

How to show the error? Possible solutions:

  1. Show toasts - the simplest way but it is not the best (for many errors we'll see many toasts, even if the application works in the background)
  2. Show error somewhere in the screen (e.g. gmail shows 'No connection' at the bottom of the list and proposes to retry)

What is your experience? How do you show user errors? Is there some guides explaining what is the best way?

like image 381
Flavio Avatar asked Jan 18 '13 13:01

Flavio


People also ask

When should you display error messages?

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.

What is error message design guidelines?

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.

Should error messages have punctuation?

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.


1 Answers

I have used the alertDialog.. refer the Images. futher google it

For user Attention.

enter image description here

for form Validation edit texts use editText.setError("Your error message") method

for form Validation edit

for internet connection failed

enter image description here

for internent connection failed with retry.

enter image description here

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

enter image description here

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

enter image description here

Hope this will be helpful

like image 191
Qadir Hussain Avatar answered Oct 03 '22 00:10

Qadir Hussain