Nearly all Android apps have to communicate information to the user, when a status changes or when an operation finishes or doesn’t go according to plan. The SDK includes the Toast message—a message you can trigger easily that appears independently of the current activity—but it has some downsides. I'll describe how to use a newer messaging architecture named Snackbar that overcomes these issues.
- [Instructor] Nearly all Android apps have to communicate…information to the user…when a status changes, when an operation finishes,…or perhaps when something doesn't go according to plan.…The SDK includes the Toast message,…a message you can trigger easily…that appears independently of the current activity.…I'll add a Toast message to the runCode method…of this application.…After I call my log method, I'll type Toast…and press tab, and then I'll pass in a literal string of…this is a Toast message.…
I'll run the app, and when I click the Run Code button,…I get the Toast message.…Now the Toast message can appear for any length of time.…I'm currently using a constant called LENGTH_SHORT.…I'll change that to LENGTH_LONG,…and then I'll run the application again.…And this time when I display the message,…and I click the Run Code button,…the message stays on the screen longer,…and this gives me an opportunity…to show you something interesting.…I'll click the Run Code button three times,…and then I'll exit the application.…
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.