फ़ोरग्राउंड सेवाएं चलाने वाले ऐप्लिकेशन को उपयोगकर्ता की ओर से रोकने की प्रोसेस मैनेज करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Android 13 (एपीआई लेवल 33) से, उपयोगकर्ता सूचना पैनल से किसी वर्कफ़्लो को पूरा कर सकते हैं. इससे, फ़ोरग्राउंड सेवाएं इस्तेमाल कर रहे किसी ऐप्लिकेशन को बंद किया जा सकता है. भले ही, उस ऐप्लिकेशन का टारगेट एसडीके वर्शन कुछ भी हो. इस सुविधा को टास्क मैनेजर कहा जाता है. इसमें उन ऐप्लिकेशन की सूची दिखती है जो फ़िलहाल फ़ोरग्राउंड सेवा चला रहे हैं.
पहली इमेज. Android 13 या इसके बाद के वर्शन वाले डिवाइसों पर, टास्क मैनेजर का वर्कफ़्लो.
इस सूची को ऐक्टिव ऐप्लिकेशन के तौर पर लेबल किया गया है.
हर ऐप्लिकेशन के बगल में, बंद करें बटन होता है. पहली इमेज में, Android 13 पर चलने वाले डिवाइस पर Task Manager के वर्कफ़्लो के बारे में बताया गया है.
जब उपयोगकर्ता, टास्क मैनेजर में आपके ऐप्लिकेशन के बगल में मौजूद बंद करें बटन को दबाता है, तो ये कार्रवाइयां होती हैं:
सिस्टम, आपके ऐप्लिकेशन को मेमोरी से हटा देता है. इसलिए, सिर्फ़ फ़ोरग्राउंड सेवा ही नहीं, बल्कि पूरा ऐप्लिकेशन बंद हो जाता है.
सिस्टम, आपके ऐप्लिकेशन की पिछली ऐक्टिविटी के बैक स्टैक को हटा देता है.
मीडिया का कोई भी कॉन्टेंट चलना बंद हो जाता है.
फ़ोरग्राउंड सेवा से जुड़ी सूचना हटा दी जाती है.
आपका ऐप्लिकेशन, इतिहास में बना रहता है.
शेड्यूल किए गए जॉब, शेड्यूल किए गए समय पर पूरे होते हैं.
अलार्म, शेड्यूल किए गए समय या समयसीमा पर बजते हैं.
की जांच करना फ़ायदेमंद होता है.
यह जांच करने के लिए कि जब कोई उपयोगकर्ता आपके ऐप्लिकेशन का इस्तेमाल करना बंद कर देता है, तब और उसके बाद आपका ऐप्लिकेशन उम्मीद के मुताबिक काम करता है या नहीं, टर्मिनल विंडो में यह ADB कमांड चलाएं:
adbshellcmdactivitystop-appPACKAGE_NAME
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[],[],null,["Starting in Android 13 (API level 33), users can complete a workflow from the\n[notification drawer](/develop/ui/views/notifications#bar-and-drawer)\nto stop an app that has an ongoing foreground services, regardless of that app's\ntarget SDK version. This affordance, called the\n*Task Manager*, shows a list of apps that are\ncurrently running a foreground service. \n**Figure 1.** Task Manager workflow on devices that run Android 13 or higher.\n\nThis list is labeled **Active apps** .\nNext to each app is a **Stop** button. Figure 1 illustrates the\nTask Manager workflow on a device that runs\nAndroid 13.\n\nWhen the user presses the **Stop** button next to your app in the\nTask Manager, then the following actions occur:\n\n- The system removes your app from memory. Therefore, your **entire app stops**, not just the running foreground service.\n- The system removes your app's activity back stack.\n- Any media playback stops.\n- The notification associated with the foreground service is removed.\n- Your app remains in history.\n- Scheduled jobs execute at their scheduled time.\n- Alarms go off at their scheduled time or time window.\n\n| **Note:** The system doesn't send your app any callbacks when the user taps the **Stop** button. When your app starts back up, it's helpful to check for the [`REASON_USER_REQUESTED`](/reference/android/app/ApplicationExitInfo#REASON_USER_REQUESTED) reason that's part of the `ApplicationExitInfo` API.\n\nTo test that your app behaves as expected while and after a user stops your\napp, run the following ADB command in a terminal window: \n\n```bash\nadb shell cmd activity stop-app PACKAGE_NAME\n```"]]