Android OEMs (Original Equipment Manufacturer) Huawei, Xiaomi, OnePlus, Samsung, Oppo, Vivo are literally turning smartphones into lazyphones. Have you ever notice your Android killing apps in the background and they suddenly stop working? I’m sure you must have seen this problem in automation apps like Notification History Log, Tasker, Wear apps, and more.
Do you know why these apps stop working on your device but continue to work flawlessly on devices running on Stock Android? If you don’t know, your device manufacturer is the culprit.
Google has already taken care of limiting background services and optimizing battery usage with Doze mode. But many OEMs have again added multiple layers of meaningless restrictions in the name of squeezing extra battery. These limitations are by default enabled for every app you download except popular apps (which are whitelisted internally) and users are unaware of it.
And for Android developers, it was a nightmare. Developers follow Google policies and they show persistent notification while running long background tasks. But even with persistent notifications, the background services are being killed by OEMs because an app is not on the whitelisted list.
One of our apps Notification History Log is also badly affected due to different restrictions imposed by different Android OEMs. The worst part is, each OEM has different implementations and no official APIs are available for requesting users to whitelist our app.
- If you are a user and notice an app stops working suddenly, please don’t leave 1-star reviews on Play Store. Try to contact the app developer first to understand why the app is misbehaving.
- If you are an OEM, please stop adding new restrictions on apps. Use Stock Android instead. It saves both you and developers a lot of time and money.
Since a lot of users and developers are looking for a solution to stop Android from killing apps in the background. We decided to write this guide to help users, developers, and our Notification History Log users.
Prevent Apps From Being Killed Automatically in your Android Smartphone
For convenience, we have taken the Notification History Log app as the app name and we’ll explain the steps in detail to whitelist it from all popular OEMs which are turning smartphones to lazyphones. If you don’t find your OEM in the list, choose “Others” to know the common steps.
Choose your manufacturer
Huawei
Huawei is well known for breaking app functionalities and developers will frequently get reports from Huawei users. We are not an exception. Over 50% of emails and 1-star reviews we receive are from Huawei devices. Unfortunately, there was no straightforward solution to whitelist Notification History Log or any other app in EMUI.
From EMUI 9, Huawei has added a new application called PowerGenie which will kill all apps unless it is whitelisted in PowerGenie app. Unfortunately, PowerGenie has no customization options available to add more apps to the whitelist and you can also uninstall/disable PowerGenie completely.
This means it is not possible to fix the problem correctly in EMUI 9. Still, it is recommended to try the common steps to temporarily solve the problem.
If you find Notification History Log or any other apps stopped working on your Huawei device, please follow the below steps to make changes in your phone settings:
Note: You might not find all the below-mentioned options on your mobile. You can safely ignore them if they are not available on your Huawei mobile.
Change 1:
- Go to phone Settings
- Select Advanced Settings.
- Tap on Battery Manager.
- Change the Power plan to Performance.
Change 2:
- Go to phone Settings.
- Select Advanced Settings.
- Open Battery Manager and tap on Protected apps.
- Set Notification History Log (or any app of your choice) as Protected.
Change 3:
- Go to phone Settings
- Select Apps.
- Choose Notification History Log (or any app of your choice) from the list.
- Tap on Battery.
- Disable Power-intensive prompt.
- Disable Close after screen locked.
- Enable Keep running after screen off (if available).
Change 4:
- Go to phone Settings
- Tap on Apps.
- Click the Settings / Gear icon at the bottom.
- Under Advanced, select Special Access.
- Now click on Ignore battery optimization and change “Allowed” to “All apps”.
- Choose Notification History Log (or any app of your choice) from the list and set it to Allow.
- Hit OK to confirm the changes.
Samsung
In the latest Samsung flagship devices, a new feature called Sleeping Apps is added. Apps that are included in this “Sleeping Apps” list will never run in the background, will never receive updates, and even can not show notifications. You need to first make sure the Notification History Log (or any app of your choice) is not added to “Sleeping Apps”.
Make the following changes in your Samsung device to stop apps from being killed automatically:
Change 1:
- Go to phone Settings.
- Open Device Care.
- Tap on Battery.
- Click on 3-vertical dots on the top right and select Settings.
- Here you need to disable
- Adaptive Battery
- Put unused apps to sleep
- Auto disable unused apps
- After disabling the above options, now click on Sleeping Apps.
- Click on the Trash icon on the top-right to remove all applications from sleep.
Change 2:
On Samsung Galaxy S8, there is yet another feature called App Power Monitor which keeps apps to sleep when not used for 3 continuous days. But there will be plenty of apps that work in the background to sync data, monitor notifications, alarms, etc, which will not be opened every day but still need to function. In this case, you need to disable App Power Monitor as explained below.
- Open phone Settings
- Tap on Device maintenance.
- Select Battery.
- Disable App Power Monitor.
Change 3:
On other Samsung devices, follow the steps below to disable battery optimization:
- Go to phone Settings.
- Tap on Applications.
- Click 3-vertical dots on the top right corner and select Special Access.
- Select Optimize Battery usage.
- Select Notification History Log (or any app of your choice) from the list and change it to Don’t optimize.
Change 4:
On older version on Samsung devices, you need to disable power saving modes as follows:
- Open phone Settings
- Select Battery.
- Click Power saving mode and turn it off.
- Click Ultra power-saving mode and turn it off.
OnePlus
OnePlus is very popular for its stunning Oxygen OS UI and features. But coming to battery optimization, it has its own limits and disadvantages. Being a user, you need to make a few changes in your phone settings to stop OnePlus from killing the apps that run in the background.
Here are the most common changes you need to make to prevents apps from killing automatically:
Change 1:
- Go to phone Settings.
- Tap on Apps.
- Click on Gear icon on the top right and tap on Special Access.
- Click on Battery.
- Choose Notification History Log from the list and change it to Not optimize.
Due to a bug in Oxygen OS, OnePlus might revert this change randomly anytime. So you need to keep an eye and change it again to “Not Optimize” if it reverts to default sometime later.
One quick solution to prevent this problem:
- Open Notification History Log (or any other app) you wish to run in the background.
- Tap on recent apps button to see the list of minimized apps.
- Now click on the Lock button on the top-right of the app preview.
Once you lock the app, it will keep running in the background and battery optimization setting will never change to default.
Change 2:
On a few OnePlus models, you need to make sure App Auto-Launch is enabled for your app. To do this:
- Go to phone Settings.
- Tap on Apps.
- Click on Gear icon on the top right and tap on App auto-launch.
- Now enable App auto-launch for Notification History Log (or any app of your choice).
Change 3:
If you are still facing random killing of app’s background services, try doing the following change:
- Go to phone Settings.
- Tap on Battery.
- Select Battery optimization.
- From the top drop-down menu, change the type to All Apps.
- Select Notification History Log (or any app of your choice) from the list and change it to Don’t optimize.
Asus
In a few Asus devices, Power Master app was pre-installed which will automatically kill background tasks when your phone screen is turned off and it also stops them from restarting. To make sure your Asus device will never kill the background running apps, you need to do the following changes on your device:
- Open PowerMaster application.
- Select Battery-saving options.
- Turn off Clean up in suspend.
- Turn off Auto-deny apps from auto starting.
- Click back and now select Auto-start manager.
- Tap on the Downloaded tab and enable Notification History Log (or any app of your choice).
Nokia
Few Nokia smartphones come with Power Saver application pre-installed which is responsible for killing apps that running in the background. Unfortunately, there is only a temporary solution available to fix this problem in Nokia devices:
- Go to phone Settings.
- Tap on Apps.
- Select All Apps.
- Tap on three vertical dots menu or gear icon on the top-right corner and select Show system.
- Scroll down to tap on Power Saver application and Force Stop it.
- If Uninstall button is available, you can uninstall Power Saver application to fix the problem permanently. Sadly, the uninstall option is enabled only on a few sets of Nokia devices.
Lenovo
Lenovo mobiles very rarely kill the background apps but there are few Lenovo devices that will instantly kill entire app processes when it is swiped away from running apps. Here is the quick solution for Lenovo users:
Change 1:
- Go to phone Settings.
- Select Apps.
- Choose Notification History Log (or any app of your choice) from the list.
- Tap on Battery.
- Change “Not optimized” to All Apps.
- Again select Notification History Log (or any app of your choice).
- Change to Don’t Optimize and hit Save/Done.
Change 2:
- Open Notification History Log (or any app of your choice).
- Tap on recent apps button to see the list of minimized apps.
- Click on the Lock button on top of the app preview.
Xiaomi
Xiaomi’s MIUI was loved by 50% of Android users and the rest of them just hate it. I’m sure 100% of developers hate MIUI for its poor APIs, documentation and bug tracking. For Notification History Log, we have completely excluded all Xiaomi mobiles (except Mi A series) from the list of supported devices.
Unfortunately for developers, no APIs are available for requesting users to make the changes or to check user settings information. Fortunately for users, they can do (a lot of) changes in their phone settings to stop MIUI from killing the background running apps:
Change 1:
- Open Security App.
- Tap on Permissions. (If you don’t find Permissions option on Security app home screen, it will be inside “Manage Apps” on few models)
- Select Auto-start.
- Now Enable auto-start for Notification History Log (or any app of your choice).
Change 2:
- Open Security App.
- Tap on Battery.
- Select App Battery Saver.
- Choose Notification History Log (or any app of your choice).
- Set it to No Restrictions.
Change 3:
- Open phone Settings.
- Click on Apps.
- Select Notification History Log (or your app of choice).
- Tap on Other permissions.
- Enable Start in background.
Change 4:
- Open phone Settings.
- Select Advanced Settings.
- Tap on Battery manager.
- Set the Power plan to Performance.
Change 5:
- Open phone Settings.
- Select Advanced Settings.
- Tap on Battery manager.
- Choose Protected Apps.
- Make sure Notification History Log (or your app of choice) is added to list of protected apps.
Change 6:
- Open phone Settings.
- Click on Apps.
- Select Notification History Log (or your app of choice).
- Tap on Battery.
- Enable Power-intensive prompt.
- Enable Keep running after screen off.
Change 7:
- Open phone Settings.
- Select Additional Options.
- Tap on Battery & Performance.
- Open Manage apps battery usage.
- Now disable Power Saving Modes.
Bonus: When you click on recent apps button at the bottom of your screen, drag the app preview downwards to pin the app. When you do this, the app will not be removed when you clear recent apps and background process of the app continue to work indefinitely.
Pixel, Nexus, and Other Stock Android Devices
Devices running on Stock Android very rarely notice apps killing in background issues. You need to first make sure you are not using any speed booster or RAM cleaner applications. If you use any similar applications which claim to improve your device speed, uninstall them immediately. They won’t work as promised and even sometimes slow down your device.
In devices running on Android Pie or higher, make sure you have NOT accidentally enabled background restrictions to Notification History Log (or any app of your choice). You can verify it at phone Settings > Apps > Notification History Log (or any app of your choice) > Advanced > Battery > Background restrictions.
If everything fails and you still face the problem, try disabling battery optimization as shown below:
- Go to phone Settings.
- Select Apps & notifications.
- Choose Notification History Log (or your app of choice).
- Tap on Battery.
- Change the dowp-down value from “Not optimized” to All Apps.
- Scroll down to select Notification History Log (or your app of choice).
- Change to Don’t Optimize.
- Hit the Done button to confirm the change.
Conclusion
Due to thousands of Android devices in the market and tens of OEMs, it is impossible to follow one single step to stop Android from killing apps in the background. And the worst part is, even devices from the same manufacturer come with different settings and options. I wish Google solves this fragmentation problem in Android and make it easier like iOS.
Being a user, all you have to do is, try the changes I have mentioned above for your device and see if it stop apps from being killed in the background. Since each device comes with different features and options, you might not find a few above settings on your mobile. In this case, you can either ignore it or check if any similar terms are available in your settings.
Cainã Rangel says
How can I do It on iPhone?
William says
This is great but I think it’s outdated. This is the exact problem I’ve having with other apps however none of these settings exist for me
Hauke says
Stock Android 12 is now killing background apps too, and all options to stop that are removed or not working. (Pixel 6 pro).
Mark says
Was this written by a child?
Amar Ilindra says
Definitely not. Why do you think so?
Nathan Kulmer says
None of these solutions worked on my TCL 10L on Android 11. An alarm app I used on my old phone doesn’t work half the time on this one because it is always getting force stopped even with battery optimization turned off AND locking it so it won’t get cleared away when I clear all apps occasionally. Very very irritating to say the least. If you have any other suggestions please let me know. Thanks!
Amar Ilindra says
Android 11 is really a nightmare for developers. A lot of apps are affected. Samsung and TCL are no exceptions.
John S says
Amar – thanks, this is a super-useful article.
Nathan , here’s a solution for TCL phones. The problem is an app called ‘Smart Manager’ that ships with TCL phones and can’t be uninstalled. ‘Smart Manager’ aggressively kills apps to preserve battery – that is what’s force-stopping your apps. See instructions below to fix this… (note: this works for other apps too, eg it enables TCL phones to be used with Parental Control apps like Qustodio, Norton Family, etc).
… using ‘Qustodio Kids’ as an example
Open Smart Manager app
… either from home screen, or from Settings > Smart Manager
1. Smart Manager > Auto-start
Turn off ‘Automatically manage’
Ensure your app is on – ‘Qustodio Kids’ in this case
2. Smart Manager > Battery
Turn off Normal saving mode
Turn off Super saving mode
3. Smart Manager > Battery > Battery detail
Turn off Battery saver
Turn off Battery manager
4. Smart Manager > Notifications
Ensure your app is on – ‘Qustodio Kids’ in this case
Bhavin says
Is it possible those settings from coding side?
As per my knowledge, it can’t possible. Inform me if it can possible.
Amar Ilindra says
No. It is not possible to do them programmatically.
The best a developer can do is opening the Intents (if available)
Martin Michaels says
I too am a developer and it is especially annoying when I switch away from my all for two second and when I come back it had to completely reload the web view. Why??? It can’t be a legitimate reason like memory pressure because it manifests when there is plenty of free memory. I will never forgive Google for not providing hooks to allow proper control of the phone your bought and paid for! Can you imagine if a desktop or laptop could at any time kill any program you were running without a darn good reason?
Dante says
Is there an app that overrides the setting making certain an app does not go to sleep? I have tried this and its not working
Sergey says
Thanks a lot!
Garage says
Thanks a lot for this post! I have a lot of problems with this and every time a customer have it, i suggest this, and almost always solves the problem. Keep it up to date
Jaskirat Singh says
It has been a nightmare! Being an Android Developer, I have been a victim of my apps being shut and put to sleep automatically by the OEMs. Even though my app works in the Doze mode and follow the guidelines according to Google, it is still shut off by the OEMs.
App vendors and users are left hanging with a useless app as it fails to function as it should.
I am doing every bit of research on this and trying to find a way to allow my app run in the background and not get killed by the OS. Hoping to find something.