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.
Android App Development: Communicating with the Userwith Joe Marini1h 12m Intermediate
Building Android Apps with Cloud Serviceswith Albert Lo2h 37m Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
New This Week:
1. Android Development Tips Weekly
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.