कुछ मामलों में, हो सकता है कि आप अपने ऐप्लिकेशन को उपयोगकर्ता को तुरंत कोई मैसेज दिखाना चाहें. इसके लिए, उपयोगकर्ता के जवाब का इंतज़ार करना ज़रूरी नहीं है. उदाहरण के लिए, जब कोई उपयोगकर्ता कोई कार्रवाई करता है, जैसे कि ईमेल भेजना या फ़ाइल मिटाना, तो आपका ऐप्लिकेशन उपयोगकर्ता को तुरंत पुष्टि दिखाता है. आम तौर पर, उपयोगकर्ता को मैसेज का जवाब देने की ज़रूरत नहीं होती. मैसेज को इतना साफ़ तौर पर दिखाना चाहिए कि उपयोगकर्ता उसे देख सके. हालांकि, यह इतना साफ़ नहीं होना चाहिए कि उपयोगकर्ता आपके ऐप्लिकेशन का इस्तेमाल न कर पाए.
इस्तेमाल के इस सामान्य उदाहरण के लिए, Android Snackbar
विजेट उपलब्ध कराता है. Snackbar, उपयोगकर्ता को तुरंत पॉप-अप मैसेज दिखाता है. Snackbar दिखने के दौरान, मौजूदा गतिविधि दिखती रहती है और उसमें इंटरैक्ट किया जा सकता है. कुछ समय बाद, Snackbar अपने-आप बंद हो जाता है.
इस दस्तावेज़ में, पॉप-अप मैसेज दिखाने के लिए Snackbar का इस्तेमाल करने का तरीका बताया गया है.
पहली इमेज.Snackbar
गतिविधि के सबसे नीचे एक मैसेज दिखाता है और गतिविधि के बाकी हिस्से का इस्तेमाल किया जा सकता है.
किसी मैसेज में कार्रवाई जोड़ने का तरीका जानें, ताकि उपयोगकर्ता उस मैसेज का जवाब दे सके.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],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."]]