From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display Snackbar messages

Display Snackbar messages - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Display Snackbar messages

- [Instructor] Toast messages are an easy way to present information to the user, but they have some downsides. First of all, a Toast message isn't part of your application's interface, it's managed independently by the application framework and the operating system. Also, a Toast message is a part of Android's notification framework and it can be completely suppressed by the user unintentionally. If the user completely stops notifications from your application they won't see your Toast messages. To deal with this Google introduced a new messaging framework in 2014 called Snackbar messages. They are part of the Material Design system, and just like the floating action button, the code for Snackbar message framework is a part of the Material Design library. It works most reliably in an activity who's layout has the CoordinatorLayout component as its root element. I'll go to my base layout, activity_main.xml, and show in text mode that the root element is CoordinatorLayout. When you…

Contents