How to Keep an App Running in the Background on Android
Allow background activity, turn on auto-start, lock the app in recent apps, and keep it running after a restart
On this page
To keep one app running in the background on Android, do three things: allow its background activity (set its battery use to Unrestricted), turn on auto-start if your phone has it, and lock the app in your recent apps. Leave every other app as it is.
The menu names below can be slightly different on your phone, because they change between brands and Android versions. If a name does not match, type "battery" or the app's name into the search bar at the top of Settings.
What does "allow background activity" mean?
An app runs in the background when it keeps working while you use other apps or while the screen is off. Background activity is what lets a messaging app receive messages, an alarm app ring on time, or an SMS gateway app send texts when nobody is looking at the phone.
"Allow background activity" means Android may let the app keep working after you leave it. When background activity is not allowed, Android pauses the app soon after you close it or turn off the screen.
Why Android stops apps in the background
There are four common reasons:
- Battery optimization. Android pauses apps in the background to save power.
- The phone brand's own battery saver. Samsung, Xiaomi, Oppo, Realme, Vivo, Infinix, Tecno, Huawei and others add a second power saver on top of Android.
- Auto-start limits. Some brands block apps from starting by themselves, for example after the phone restarts.
- Clearing recent apps. On many phones, clearing your recent apps closes every app that is not locked.
The steps below fix all four.
Step 1: Allow background activity
On most phones, open Settings > Apps, tap the app, then Battery (or App battery usage) and choose Unrestricted. On Android 14 and newer, turn on Allow background usage first. On older Android, look for Battery optimization and set the app to Don't optimize.
Each brand puts this in a slightly different place. Our battery optimization guide for every phone brand has the exact steps, and Samsung owners can use the Samsung battery optimization guide.

Step 2: Turn on auto-start
Auto-start lets the app start by itself, for example after the phone restarts. Stock Android, Pixel and Samsung phones do not have this switch, so skip this step on those phones.
- Xiaomi, Redmi, Poco: turn on Autostart on the app's page in Settings > Apps > Manage apps. See Xiaomi, Redmi, Poco.
- Oppo, Realme, OnePlus: turn on Allow auto launch in the app's Battery usage page, where shown. See Oppo, Realme, OnePlus.
- Vivo: Settings > Apps > Autostart, then turn the app on. See Vivo.
- Infinix, Tecno, itel: use Auto-start management in Settings > App management, XManager or Phone Master. See Infinix, Tecno, itel.
- Huawei, Honor: Settings > Battery > App launch, turn off Manage automatically, then turn on Auto-launch. See Huawei, Honor.
Step 3: Lock the app in recent apps
Open your recent apps (swipe up from the bottom and hold, or tap the square button). Press and hold the app's card, or tap the app icon above the card, then tap the lock icon. A small lock shows on the card.
Now "clear all" leaves that app running. To unlock it later, do the same again.

Step 4: Keep it running after a restart
After the phone restarts, an app can only start by itself if Android allows it. Check two things:
- auto-start is on (Step 2) on phones that have it
- you opened the app once after installing it, because Android does not let an app start by itself if it was never opened, or if it was force stopped
If the app still does not come back after a restart, open it once by hand and check the steps above again.
How to see which apps are running in the background
- Battery use per app: open Settings > Battery and look for Battery usage or App battery usage. Apps that used battery in the background show there.
- Running services: for advanced users, turn on Developer options and open Running services to see what is running right now.
Apps that must run all the time, such as an SMS gateway app, also keep a small notice in your notification shade while they run.
Which apps should keep running, and which to stop
Let these keep running in the background:
- apps that send or receive messages you need on time
- alarms, reminders and health trackers
- an SMS gateway app, if your business sends texts from this phone
To stop apps running in the background, do the opposite: open Settings > Apps, tap the app, then Battery, and choose Optimized or Restricted. You do not need a "task killer" app; Android already manages this, and those apps can stop the apps you do want running.
Sending SMS from your own SIM?
The WaSMS SMS app keeps itself running and starts again by itself after the phone restarts. Its Keep running screen shows the steps for your phone's brand and Android version. If the phone stops checking in, the organization owner gets an email and a WhatsApp after 30 minutes. Set up your SMS phone to get the app.

What to read next
- How to turn off battery optimization on Android
- Samsung battery optimization
- Gateway offline: fast fixes
- Android SMS gateway setup
For a community list of brand-specific battery savers, see dontkillmyapp.com.
Frequently asked questions
Try it with your own number
Create a free WaSMS account, connect your WhatsApp, and send your first message today.