You know the moment. Spotify's playing, you hop over to WhatsApp for ten seconds to answer a message, hop back — and the music's gone. The app restarted itself. Or your fitness tracker quietly died halfway through a run, and your 5K now looks like a warm-up lap. Maybe your VPN dropped an hour ago and you only just noticed.
Your phone isn't broken. It's doing exactly what Android was designed to do: shut down background apps to save battery and RAM. The trouble is that it does it too eagerly — Samsung's One UI and Xiaomi's HyperOS are especially aggressive about deep-sleeping apps you actually need. The fix is figuring out which of Android's app-killing layers grabbed your app — and switching that one off. Six fixes, most-effective-first. Covers Android 10 through 14.

Quick Answer: Most background app-killing is battery optimization being too aggressive. Exempt the app: Pixel — Settings → Apps → See all apps → [app] → App battery usage → Unrestricted; Samsung — Settings → Apps → [app] → Battery → Unrestricted, then pull it out of Settings → Battery → Background usage limits (Sleeping / Deep sleeping apps); Xiaomi — Settings → Apps → Manage apps → [app] → Battery saver → No restrictions. Still dying? Lock the app in the recent-apps screen — the padlock / Keep-open option stops the system from closing it.
In This Guide:
Why Apps Close in the Background
Here's the mental model that makes everything else click: Android treats background apps as guests, not residents. The moment you leave an app, the system starts deciding whether it deserves to keep running — and that decision passes through several independent gatekeepers. Any one of them can end the app:
- Battery optimization — a per-app setting, and the usual suspect. Limits what the app may do with the screen off.
- Adaptive Battery — system-wide learning that throttles apps you open rarely.
- Manufacturer sleep lists — Samsung's Sleeping / Deep sleeping apps, Xiaomi's battery saver: extra layers stacked on top of stock Android.
- Background data restriction — the app stays "alive" but can't reach the internet, so it looks dead.
- Low RAM or full storage — the system reclaims memory by force, no permission asked.
- Task-killer apps — third-party "boosters" doing the killing for you. Ironic, and common.
Triage shortcut: music stops, downloads die, tracker resets → Fix 1. Only happens on Samsung or Xiaomi → Fix 1's brand steps, then Fix 6. App restarts but notifications still arrive → Fix 4; it's starved, not killed.
Fix 1: Disable Battery Optimization for the App
Start here. This one setting sits behind the majority of background-kill complaints, because it's the first gatekeeper every app passes through. You're simply telling Android to leave this particular app alone:
- Pixel (Android 12 and newer): Settings → Apps → See all apps → tap the app → App battery usage → Unrestricted.
- Samsung (One UI): Settings → Apps → tap the app → Battery → Unrestricted.
- Xiaomi / Redmi / POCO (HyperOS or MIUI): Settings → Apps → Manage apps → tap the app → Battery saver → No restrictions.
- Anything else: Settings → Battery → Battery optimization (or Settings → Apps → Special app access → Optimize battery usage) → find the app → Don't optimize.
- Restart the phone, use the app normally for a few hours, and check whether it survives now.
Caution: exempt only apps that keep dying — alarms, music, messaging, trackers. Exempting everything costs noticeable battery life.

Fix 2: Lock the App in Recent Apps
Think of this as a deadbolt on top of Fix 1's latch. Most Android skins let you pin an app's card in the recent-apps screen so neither "Close all" nor the system's auto-cleaner can touch it:
- Open the problem app, then open Recent apps (the square button, or swipe up and hold).
- Tap the app icon at the top of its card — or long-press the card — and choose Lock this app. Samsung calls it Keep open; Xiaomi shows a padlock icon.
- A small lock badge appears on the card. From now on, clearing recents skips this app entirely.
No lock option? You're on a third-party launcher — it returns on the stock one. This trick earns its keep on Xiaomi and Samsung, where the system cleaner is most enthusiastic.
Fix 3: Turn Off Adaptive Battery
Adaptive Battery watches which apps you open and quietly throttles the rest. Use an app daily and it leaves it alone; open it twice a week — a security camera, a podcast player — and it starts getting shut down behind your back:
- Open Settings → Battery and look for Adaptive Battery (on Samsung it's under Settings → Battery → More battery settings).
- Two options: switch it off entirely, or keep it on and exempt just your important apps with Fix 1.
- Some phones also show a restricted apps list under Settings → Battery → Battery usage — if your app sits on it, take it off.
Recommendation: leave Adaptive Battery on — it genuinely improves standby — and exempt the two or three apps that matter. Switching it all off works, but your battery will feel it.
Fix 4: Allow Background Data Usage
Plot twist: sometimes the app was never killed at all. It just can't reach the internet in the background, so messages stop arriving and downloads stall — which feels exactly like a crash:
- Settings → Apps → See all apps → tap the app → Mobile data & Wi-Fi (on Samsung: Settings → Apps → [app] → Mobile data).
- Allow background data usage must be switched on.
- If the screen offers Allow data usage while Data Saver is on, enable that too.
- System-wide Data Saver users: open Settings → Network & internet → Data Saver and add the app to the unrestricted list there as well.
- Xiaomi: Settings → Apps → Manage apps → [app] → Data usage — confirm background data is allowed on both mobile data and Wi-Fi.
Diagnostic: app perfect in the foreground but silent the moment you leave? Data starvation is likelier. Fixes 1 and 4 together cover both the kill and the starve.

Fix 5: Free Up RAM and Storage
When RAM runs dry or free storage drops under roughly 10%, Android stops asking politely and starts force-closing background apps to keep the foreground one alive. Budget phones with 3–4 GB of RAM hit this wall first:
- Storage: open Settings → Storage. If you're under ~10% free, clear heavy app caches, delete big downloaded files, move photos to a backup.
- Uninstall the "helpers": third-party RAM boosters and task killers cause this exact problem — they force-close background apps on a schedule. Remove them; Android's own memory management plus Device care is enough.
- Reboot once a week. A fresh boot clears leaked memory. Cheapest maintenance there is.
Fix 6: Fix Samsung's Background Usage Limits
Samsung owners, this one's yours. One UI stacks its own app-management layer on top of standard battery optimization — an app can be set to Unrestricted and still get slept:
- Open Settings → Battery → Background usage limits.
- Check Sleeping apps and Deep sleeping apps. If your app appears in either, remove it and add it to Never auto sleeping apps instead (tap + and select it).
- At the top of the same screen, consider switching off Put unused apps to sleep so Samsung stops auto-sleeping things you haven't opened lately.
- Also peek at Settings → Device care → Auto optimization — make sure it isn't restarting the phone or closing apps overnight.
Other brands have equivalents: Xiaomi's Settings → Battery → App battery saver, OnePlus's Settings → Battery → Battery optimization → Advanced optimization. Same hunt, different menus.
What If Nothing Works?
Last checks before blaming the phone: update the app — developers do fix excessive background restarts in newer versions. Temporarily disable any VPN, antivirus, or "phone booster" app and test; these intercept background activity and are frequent hidden culprits. Boot into Safe Mode (hold the power button, long-press "Power off", tap Safe Mode) — if the app stays alive there, a third-party app is the killer; find it by removing recently installed apps one by one. Final option: Settings → Apps → ⋮ menu → Reset app preferences, which restores default permissions and restrictions without deleting your data.
Watch: Apps Closing Automatically Fixed Step by Step
Prefer a walkthrough? This video covers apps that keep closing/crashing step by step:
Video by Master It Yourself — full credit to the creator.
Related Guides:
Frequently Asked Questions
Why does Android kill my apps even when the battery is at 90%?
Battery percentage and background management are separate systems. Android kills background apps based on usage predictions and power rules — not the charge level. A phone at 90% will still sleep an app that Adaptive Battery or the manufacturer's optimizer has flagged. Exempting that specific app from battery optimization (Fix 1) is the direct answer.
Is it safe to set an app to "Unrestricted" battery usage?
It won't damage anything — the worst case is somewhat faster battery drain from that app. The setting applies only to the apps you choose, so limit it to the few that genuinely need to stay alive: alarms, messaging, music, health trackers. For everything else, the default Optimized setting is fine.
Will a RAM cleaner or task killer app keep my apps open?
They do the opposite: task killers force-close background apps — literally the problem you're solving. Android manages memory itself, and reopening killed apps costs more battery than leaving them parked in RAM. If you have a cleaner, booster, or task-killer installed, removing it alone sometimes fixes everything.
By Sameer Zehri | App Fix Guru Editor | Last updated: October 2026