Why Android Apps Keep Closing in the Background
Short answer
Set the app to Unrestricted under Settings → Apps → [app] → Battery, and turn off any "adaptive" or "sleeping apps" feature your manufacturer adds on top. Samsung, Xiaomi and OnePlus kill background apps far more aggressively than stock Android does, and on those phones the battery setting alone is not enough — you also have to remove the app from the sleeping-apps list.
On this page
A podcast stops mid-episode when you open the camera. A fitness tracker loses half a run. A large upload restarts from zero every time you switch apps. The phone has 8GB of RAM and six apps open.
This is not a memory problem, and the advice that follows from assuming it is fixes nothing. Close other apps, install a RAM cleaner, buy a phone with more memory: none of it changes the behaviour. Android is killing those apps deliberately, to save battery, and on some brands a second system is killing them again on top of that.
Three different things are stopping your apps
They have different causes and different fixes, so identify yours first.
| Symptom | Mechanism | Where the fix is |
|---|---|---|
| App dies within minutes of leaving it | Battery optimisation | App info → Battery |
| App dies after a day or two unused | Adaptive Battery / app standby buckets | System battery settings |
| App dies instantly, even while playing audio | OEM task killer | Manufacturer’s own menu |
| Notifications arrive late but app survives | Doze mode batching | Same as above, usually |
| App restarts rather than resuming | Process killed, state not saved | Partly the app’s fault |
That last row is worth separating out. Android is allowed to kill a background process at any time; well-written apps save their state so you come back to where you were. An app that always restarts from the splash screen is partly badly written, and no setting on your phone fixes that.
What Android does by default
Stock Android applies two layers of restriction, both reasonable.
Doze and app standby. When the screen has been off and the phone still for a while, the system batches background work into periodic maintenance windows instead of letting apps wake whenever they like. Apps you rarely open get placed into progressively more restrictive standby buckets, so an app untouched for a fortnight gets almost no background time at all.
Battery optimisation per app. Every app sits in one of three states, and the middle one is the default:
- Unrestricted — can run in the background freely and use battery as needed.
- Optimised — the default. The system decides when it may run, based on usage patterns.
- Restricted — cannot run in the background at all. Notifications arrive only when you open the app.
On a Pixel or a Motorola, moving an app to Unrestricted genuinely solves this. Go to Settings → Apps → [app] → App battery usage and choose it. The equivalent screen exists on every Android phone, but it is labelled differently and sits at slightly different depths depending on the manufacturer. Look for the battery entry inside the app’s info page.
Why Samsung, Xiaomi and OnePlus need more
These manufacturers run their own background management on top of Android’s, with their own lists and their own rules, and it does not respect the Unrestricted setting reliably. This is why advice that works for one reader does nothing for another.
Samsung One UI
Samsung maintains lists of apps it will put to sleep regardless of their battery setting. They live in the battery section of settings, under the background usage limits area, and there are typically three of them:
- Sleeping apps — run only occasionally.
- Deep sleeping apps — never run in the background at all.
- Never sleeping apps — exempt.
Check whether your app has been added to either of the first two automatically, which happens when you have not opened it for a while. Remove it from those lists and add it to Never sleeping apps. There is also a master switch for putting unused apps to sleep automatically, which is worth turning off if this keeps recurring.
Samsung’s device care feature has an automatic optimisation routine that can also close background apps on a schedule. If apps die at the same time each day, that is where to look.
Xiaomi, Redmi and POCO
The most aggressive of the mainstream brands, and the hardest to fully disable. Three things need changing, in the app’s own settings page within the system settings app rather than in a central menu:
- Autostart must be enabled, or the app cannot start itself at all after being killed.
- Battery saver for that app set to no restrictions.
- In the Recents screen, lock the app so the clear-all gesture does not kill it.
Even with all three, some background work is still curtailed. This is a known characteristic of the platform rather than a fault on your device.
OnePlus and Oppo
Similar in design to Xiaomi’s, with per-app background settings inside the battery section and an overall optimisation toggle. The specific labels have changed several times across versions, so look for the per-app battery entry and switch off whatever restriction it offers rather than hunting for a particular string.
The apps that are allowed to survive
Android does provide a guaranteed mechanism, and understanding it explains a lot of otherwise confusing behaviour.
An app that genuinely must keep running declares a foreground service, and in exchange it must display a persistent notification. That notification is not clutter the developer forgot to remove. It is the contract. Music players, navigation, call recorders and fitness trackers all work this way, and that is why they survive when your note-taking app does not.
If an app offers a setting along the lines of “keep running in the background” or “show persistent notification”, enabling it converts the app to this model and is far more reliable than fighting the battery settings.
Conversely, an app doing background work without a foreground service is relying on being scheduled, and scheduling is exactly what the battery optimiser controls. It will be killed eventually, by design.
The cost of exempting everything
There is a real trade here, which most guides on this topic skip.
Every app you move to Unrestricted or Never sleeping can wake the CPU and the radio whenever it wants, for as long as it wants. One or two is unnoticeable. Fifteen turns a phone that lasted a day into one that does not, and the drain appears overnight when you are not there to see it happen. Overnight standby drain covers how to spot it, and which app is responsible covers how to read the evidence.
Exempt the handful of apps whose background work you actually depend on. Everything else should stay Optimised.
What does not help
- Task killer and RAM booster apps. They do the opposite of what you want here: they kill the very background processes you are trying to keep alive, and the apps restart at a higher energy cost than leaving them cached.
- Swiping apps away in Recents to “free memory”. A cached app costs nothing. Removing it guarantees a slow cold start later, and on Samsung it also clears any lock flag you had set.
- Buying a phone with more RAM for this reason. Memory pressure is rarely the cause. A 12GB phone with an aggressive task killer behaves worse than an 8GB Pixel.
- Developer options → background process limit. It makes things worse. The default of “standard limit” is correct.
- Factory resetting. The OEM policy is part of the system software. A reset restores it exactly as it was.
Realistic expectations
On a Pixel or stock-Android phone, setting the app to Unrestricted usually ends the problem outright. On Samsung it takes two changes rather than one, and on Xiaomi it takes three with no guarantee that every kind of background work survives even then.
What no setting will fix is an app that restarts rather than resuming when it is killed. Android reserves the right to end a background process at any time, and apps are expected to handle that. If yours loses your place every time regardless of exemptions, the limitation is in the app, and the honest answer is to report it to the developer or find an alternative that saves its state properly.