[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Pop-up messages overview\n\nTry the Compose way \nJetpack Compose is the recommended UI toolkit for Android. Learn how to add notifications in Compose. \n[Snackbar →](/develop/ui/compose/components/snackbar) \n\nThere are situations where you might want your app to show a quick message to the user, without\nnecessarily waiting for the user to respond. For example, when a user performs an action like\nsending an email or deleting a file, your app shows a quick confirmation to the user. Often, the\nuser doesn't need to respond to the message. The message needs to be prominent enough that the user\ncan see it, but not so prominent that it prevents the user from working with your app.\n\nAndroid provides the\n[Snackbar](/reference/com/google/android/material/snackbar/Snackbar)\nwidget for this common use case. A `Snackbar` provides a quick pop-up message to the\nuser. The current activity remains visible and interactive while the `Snackbar` is\ndisplayed. After a short time, the `Snackbar` automatically dismisses itself.\n\nThis documentation shows you how to use `Snackbar` to show pop-up messages. \n\n\n**Figure 1.** A `Snackbar`\nshows a message at the bottom of the\nactivity, and the rest of the activity is still usable.\n| **Note:** The `Snackbar` class supersedes [Toast](/reference/android/widget/Toast). While `Toast` is supported, `Snackbar` is the preferred way to display brief, transient messages to the user.\n\nAdditional resources\n--------------------\n\n\n**[Build and display a pop-up message](/develop/ui/views/notifications/snackbar/showing)**\n:\n Learn how to use a `Snackbar` to display\n a brief message to the user.\n\n\n**[Add an action to a message](/develop/ui/views/notifications/snackbar/action)**\n:\n Learn how to add an action to a message, letting the user respond to\n the message."]]