Hi and welcome to my third Android post. So long I am now on tutorial #6 from previously mentioned guide, and there are no slighter difficulties. One useful tweak I would like to talk about is class Toast in Android API.
Toast is used for displaying short messages for user. It`s main plus is, that it does not steal focus, so it is perfectly suitable to report about completed actions as: your message have been send, alarm have been set, option are saved etc.
It is defined as follows:
Toast.makeText(getApplicationContext(), "Saved!", Toast.LENGTH_SHORT).show().
First argument is just Context of current application, above which Toast should be displayed, second parameter is text of Toast itself and at last, there is parameter about duration. You could choose SHORT or LONG. Does not forgot about .show() parameter in the end, or else you will be lost as me and keep googling. Message itself has native look, so it is perfectly suitable for short messages. By now it is also for me only way to debug applications, because I am not so far by now. As soon I will come in touch with debuging, I will report as soon as possible.
Good bye for now and have some Toast. :-)
No comments:
Post a Comment