When using a custom dialog in an Android App how i开发者_JAVA百科s it then possible to let the user know, that he/she has entered a wrong argument, e.g. a wrong password or username?
Possible an AlertDialog or just a Toast_Message?
Thank you
You can add a textview to your customdialog, if the user/password combination fails, you only need to display this textview with the message wanted.
It will be better than AlertDialog, 2 consecutives dialog aren't good for the user. And the toast message are not always understandable for all users.
You can use whatever you want in principle. Flash the screen and all LEDs generate all possible sounds to make the phone R2D2s clone on speed.
On a more serious note. A Toast
notification can be used but is not necessarily a good option since it could happen that the users just does not pay attentions and misses the whole notification resulting in a confused user as he is expecting the application to log him in.
Now there is the AlertDialog
notification which is probably the most suitable notification type to inform a user about something critical he did or didn't. It requires users attention which is exactly what you want in such cases.
There would be the StatusBarNotification
which is meant to display an ongoing process. Best example would be a download or something.
Another option would be an appearing TextView
which needs to be distinctive enough to be easily noticed by the user and of course the layout has to be planned to support such dynamic changes.
My recommendation is the AlertDialog
and if not applicable for some reason then the dynamic TextView
.
精彩评论