You launch the messenger, turn on music or a navigator, minimize the screen, and after a few minutes the system forcibly stops the process. This is one of the most common complaints among modern smartphone users. The operating system Android, especially in the latest versions, aggressively manages RAM and battery consumption.

Shell manufacturers, such as MIUI, One UI or ColorOS, add their own "process killer" algorithms, which are often even tougher than Google's standard mechanisms. As a result, important notifications do not arrive, music cuts out, and file downloads are interrupted at the most inopportune moment.

You can solve this problem by correctly configuring energy saving settings and allowing specific apps to run in the background without restrictions. In this guide, we will look at all available methods: from standard system settings to advanced commands through debugging.

Why Android closes applications in the background

The main reason for forcing services to stop is battery optimization. Starting with Android 6.0, the Doze Mode function has been introduced, which puts the device into deep sleep mode when idle. In this state, network activity is blocked, and background processes are frozen to save energy.

However, modern manufacturers go further. They implement their own task managers that analyze user behavior. If you rarely open a particular app, the system may mark it as “rarely used” and limit its ability to run in the background. This is done in order to free random access memory (RAM) for more active tasks.

It is also worth considering that some applications themselves are programmed incorrectly. They can consume too much processor resources or constantly wake up the device (wakelocks), which forces the system to forcibly “kill” them for the sake of the stability of the entire smartphone.

⚠️ Attention: Completely disabling restrictions for all apps will immediately drain the battery quickly. The Android system is designed to balance between performance and autonomy.

📊 What is the most common problem with the background?
Messengers do not send notifications
Music stops when the screen is off
Downloads are interrupted
Applications simply crash

Setting exceptions in battery optimization

The most effective and safest way to solve the problem is to add the desired application to the list of exceptions of the energy saving system. This will give the app the green light to work in the background, ignoring standard Doze Mode restrictions.

The algorithm of actions may differ slightly depending on the smartphone model, but the general logic is the same. You need to find the section responsible for managing the power of specific apps. Usually it is located in the general system settings or in the special “Phone Manager” application.

You need to find the item Battery or Device care. Within this section, look for a subsection related to background activity. The names may vary: “Background restrictions”, “Battery consumption by applications” or “Autostart”.

  • 🔋 Go to Settings → Applications → Special access → Battery optimization.
  • 📱 In the list that opens, select “All applications” (often, by default, only optimized ones are displayed).
  • 🚫 Find the desired app and switch the toggle switch to the “Do not optimize” or “No restrictions” position.

After performing these actions, the system will no longer forcefully terminate the selected process applications even if the screen is turned off for a long time. This is critical for messengers, activity trackers and navigation apps.

💡

If you cannot find the item you need in the menu, use the settings search. Enter the word “Battery” or the name of the application in the search bar to quickly go to the desired menu.

Manage autorun and background activity

Many users do not know that on smartphones with shells from Chinese manufacturers (Xiaomi, Huawei, Honor, Oppo) there is a separate autorun control mechanism. Even if you have allowed work in the background, the application may not start after rebooting the phone without explicit permission.

The function Autostart allows the app to start immediately after turning on the device. Without this permission, many services simply “sleep” until you manually open their icon. This is a common reason why notifications do not arrive in the morning after an overnight reboot or low battery.

In addition, there is the concept of “Freeze” or “Deep Sleep”. Some shells, for example One UI from Samsung, have a “Sleeping Applications” function. If a app is on this list, it will never run in the background until you open it. You need to check whether an important application is blacklisted.

Manufacturer Section name Path to settings
Xiaomi / Redmi Autostart Security → Permissions → Autorun
Samsung Inactive applications Settings → Battery → Background restrictions
Huawei / Honor Launch applications Settings → Battery → Launch applications
Oppo / Realme Autostart Phone Manager → Permissions → Autostart

Please note that the interfaces are being updated. If you do not find an exact match of paths, look for similar sections related to permissions or power management.

⚠️ Attention: Settings interfaces may change with firmware updates. If the described path does not match, use a search inside the settings menu using the keywords “Startup” or “Background.”

Pinning applications in RAM

Another method that is often overlooked is manually pinning an application in RAM through the recent tasks menu. This action signals to the system that this application is a priority and should not be unloaded when there is a lack of resources.

To do this, open the multitasking menu (the “Square” button or swipe up from the bottom and hold). Find the application card you need. Depending on the version of Android and the shell, you need to either click on the application icon at the top of the card, or swipe down on the card, or look for the “lock” icon.

After clicking on the lock icon, a closed lock symbol will appear next to the application. This means that when you clear the memory with the “Close All” button, this application will remain in the list of running ones. The system will try to store it in RAM for as long as possible.

☑️ Checking application settings

Completed: 0 / 4

It is worth understanding that consolidation in memory does not provide a 100% guarantee. If the system is critically short of free RAM to run a heavy game or camera, it may ignore the lock and unload the background process. However, for most scenarios, this method works effectively.

Disabling power saving mode

A global factor that affects the operation of all applications is the general power saving mode. When the battery charge drops below a certain level (usually 15% or 20%), the smartphone automatically enters saving mode.

In this mode processor clock speed lows, the screen brightness is reduced, and background synchronization and network activity for most applications are completely blocked. Even if you have configured exceptions, in austerity mode the system may ignore them in order to save power.

If it is critical for you to keep applications running in the background, make sure that the power saving mode is disabled. It is also worth checking out the “Super Energy Saving” or “Ultra Saving” settings, which turn the smartphone into a dialer, leaving only basic functions active.

In some cases, it is useful to set the energy saving to automatically turn on only when the charge is very low, for example, at 5%, so as not to suffer from problems with background processes throughout the day.

Advanced settings via ADB

For experienced users for whom standard settings are not enough, it is possible to control background processes through the debug bridge ADB (Android Debug Bridge). This method allows you to interfere with the operation of the system at a deeper level.

Using the command line, you can prevent the system from “killing” the processes of a specific application. This is especially true for older devices or custom firmware, where interface settings are limited. To work, you will need a computer and USB debugging enabled on your smartphone.

The command to prevent stopping the process is as follows:

adb shell am set-inactive com.package.name false

Here com.package.name you must replace it with the real name of the application package (for example, com.whatsapp). You can also use the command cmd appops to fine-tune permissions to run in the background if the standard menu does not give the desired result.

How to find the name of the application package?

Install the App Inspector application or use the adb shell dumpsys package | grep "Package name" in the console to find out the exact package name of the desired app.

⚠️ Warning: Using ADB commands requires caution. Incorrect commands can lead to unstable system operation or cyclic reboot of the device. Use this method only if you understand the essence of the commands.

Specifics of the work of instant messengers and social networks

Messengers deserve special attention. Unlike players or navigators, they use a mechanism Push notifications through Google Play services (FCM). This means that the application itself can be closed, but the message will still arrive through the system channel.

However, if you use instant messengers without Google services (for example, on new Huawei models or custom builds), working in the background becomes critically important. In this case, the application must be constantly active in order to poll the server for new messages.

For such scenarios, a combination of all of the above methods is required: autorun + no battery optimization + memory pinning. Without this, you risk receiving messages with a delay of several hours.

💡

For instant messengers without Google services, it is critical to allow unlimited work in the background, otherwise notifications will not arrive in a timely manner.

Frequently asked questions (FAQ)

Why does the application close even after all the settings?

Your device may have a third-party memory cleaner or antivirus installed that takes precedence over system settings. Check the settings of such apps and add the desired application to their white list (exceptions).

Does closing applications in the background affect battery life?

Yes, allowing work in the background increases battery consumption, since the processor and radio module do not go into deep sleep. However, modern processors cope effectively with background tasks, and the increase in consumption is usually not critical for important applications.

Is it possible to prohibit closing all applications at once?

It is impossible to globally disable process killing for all apps without obtaining root access and installing special modules. This would be impractical, as it would lead to rapid discharge and system slowdowns due to full RAM.

How to check if an application is running in the background?

Go to Settings → For developers → Process statistics (path may vary). There you will see a list of active services and their operating hours. You can also use the command adb shell dumpsys activity processes.

Are settings reset after updating Android?

With a major update to the Android version (for example, from 13 to 14), permissions and battery optimization settings can be reset to factory settings. After updating the system, it is recommended to re-check the settings of important applications.