Best practice for displaying error messages

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)