You launch an Android app, get distracted for a couple of minutes - and it is already closed by the system. Is this a familiar situation? Android aggressively manages background processes, saving battery power and RAM. But what if you need the messenger to continue to receive notifications, the navigator to not reset the route, and the music player to not be interrupted? In this article, we will look at 7 proven methods prevent automatic closing of apps - from standard settings to hidden functions for experienced users.

The problem is not in your smartphone: this is a feature of the work Android starting from version 6.0 (Marshmallow), when Google has tightened its memory management policies. Manufacturers like Samsung, Xiaomi or Huawei added their own layers of optimization, which further complicated the situation. We will not advise to โ€œjust turn off optimizationโ€ - instead we will show point solutions for different scenarios: from everyday tasks to working with ADB.

Important: some methods require developer rights or root-access. If you are not ready to experiment, focus on the first three sections with safe settings. For those who want to understand more deeply, we have prepared a table of compatibility of methods with popular brands and instructions on ADB.

๐Ÿ“Š How often does Android close your applications?
Constantly, it infuriates!
Sometimes, but tolerable
I used to close it, now no
Never noticed a problem

1. Disabling battery optimization for a specific application

The safest and most universal method is to exclude the app from the list of optimized ones. This function appeared in Android 6.0 and works on all modern devices, but the path to the settings may differ.

Instructions for standard Android (for example, Pixel or Motorola):

  1. Open Settings โ†’ Applications โ†’ All applications
  2. Select the desired application (for example, Telegram or Google Maps)
  3. Tap on Battery โ†’ Battery optimization
  4. In the drop-down menu, select All applications, find yours and install All applications Battery โ†’ Application selection โ†’ [Application] โ†’ Unlimited Don't optimize

On smartphones Xiaomi (MIUI), Huawei (EMUI) or Samsung (One UI) the path will be different:

  • ๐Ÿ“ฑ Xiaomi/Redmi/Poco: Settings โ†’ Battery โ†’ Select apps โ†’ [Application] โ†’ Unlimited
  • ๐Ÿค– Huawei/Honor: Settings โ†’ Applications โ†’ [Application] โ†’ Battery โ†’ Launch control โ†’ Manual โ†’ Secondary launch (on) + Autostart (on)
  • ๐ŸŒŒ Samsung: Settings โ†’ Caring for your device โ†’ Battery โ†’ Settings (โš™๏ธ) โ†’ Sleepy applications โ†’ Remove yours from the list

Opened battery settings|Application excluded from optimization|Checked autorun (for Huawei/Xiaomi)|Rebooted device to apply changes-->

โš ๏ธ Attention: On some firmware (for example, ColorOS from Oppo/Realme) after disabling optimization, you may need to additionally enable Blocking in the background in the application settings. Otherwise, the system will still suspend it after 5-10 minutes without activity.

2. Fixing an application in multitasking (Pin Window)

If you need to temporarily โ€œpinโ€ an application on the screen so that it does not close when switching to other tasks, use the function Fixing a window. This is useful for navigators, streaming services or instant messengers during important calls.

How to freeze an application:

  1. Open the desired application (for example, YouTube Music or Google Maps)
  2. Click on button Recent applications (square or swipe up)
  3. Click on the application icon at the top of the card and select Pin (or Pin)

To unpin, hold down the Back and Recent buttons at the same time (or swipe up + hold).

Window docking restrictions

The function works only for one application at a time.

Not all manufacturers support fixing (for example, some Huawei models do not have it).

In fixed mode, you cannot use other applications (except notifications).

๐Ÿ’ก Useful tip: On Samsung s One UI you can enable Floating windows for multitasking. Long-press the application icon in the recent menu โ†’ select Open as a pop-up window. This way you can use the navigator and the messenger at the same time.

3. Using developer mode for background activity

Hidden settings developer mode allow you to flexibly manage background processes. For example, you can increase the limit of background applications or disable automatic memory release.

How to enable developer mode and configure background activity:

  1. Go to Settings โ†’ About phone โ†’ Build number and tap on it 7 times until a notification appears You have become a developer!
  2. Go back to Settings โ†’ System โ†’ For developers (the path may differ on some devices)
  3. Find options related to background processes:
    • Background process limit โ†’ set Standard limit or No restrictions (if available)
    • Do not save actions โ†’ disable (otherwise Android will kill applications when minimized)
    • Restrict background activity โ†’ disable for critical applications
๐Ÿ’ก

On Xiaomi in developer mode there is a separate item Optimizing MIUI โ€” disable it if you want maximum freedom for background tasks.

โš ๏ธ Attention: Changing parameters Limit of background processes can lead to increased battery consumption i system slowdownif you set a value higher than the standard one. We recommend testing the settings one by one and monitoring performance.

Brand Path to background process settings Recommended value
Google Pixel For developers โ†’ Background process limit Standard limit
Samsung For developers โ†’ Limit background activity Disabled for key applications
Xiaomi/Redmi For developers โ†’ MIUI optimization Disabled
Huawei/Honor For developers โ†’ Managing background processes Manual mode

4. ADB commands to forcibly disable optimization

If the standard settings do not help, you can use ADB (Android Debug Bridge) to deeply customize the system. This method requires a connection to a computer, but gives maximum control.

Instructions for using ADB:

  1. Download Platform Tools from the official Android website and unpack the archive.
  2. Enable USB debugging in the settings developer on the phone.
  3. Connect the phone to the computer and run the command line (or Terminal on Mac/Linux) in the folder with adb.
  4. Enter the command to check the connection:
    adb devices

    The name of your device.

  5. Use one of the commands to disable optimization:
    adb shell dumpsys deviceidle force-idle

    or for a specific package (for example, Telegram):

    adb shell cmd package set-inactive com.android.thememanager
    (replace com.android.thememanager with your application ID)
  6. โš ๏ธ Attention: Incorrect use of ADB may break system stability. Before experiments, create a backup copy of your data via adb backup or manually.

    How to find the application package ID?

    Install App Inspector from Google Play or use the command:

    adb shell pm list packages | grep "application_name"

    For example, for WhatsApp package ID - com.whatsapp.

    ๐Ÿ’ก Helpful advice: To keep the changes after a reboot, use the command:

    adb shell cmd deviceidle disable

    But remember: this will completely disable battery optimization for all applications, which can reduce battery life.

    5. Watchdog applications: how they work and whether they are worth using

    Google Play has utilities that promise to โ€œprotectโ€ applications from being closed by the system. The most popular: Greenify, Don't Kill My App! i Background Mode. But how do they actually work?

    The mechanism of action of such apps:

    • ๐Ÿ”„ Restarting processes: some utilities monitor closed applications and automatically restart them (this does not prevent closing, but masks it).
    • ๐Ÿ›ก๏ธ Block optimization: more advanced solutions (for example, Greenify in Boostmode) disable battery optimization for selected applications.
    • โšก Simulation of activity: send empty notifications or ping requests so that the system thinks that the application is actively used.

    โš ๏ธ Warning: Most of these applications require Accessibility rights (Accessibility Servicewhich can be Security risk. For example, in 2022, researchers discovered vulnerabilities in several popular gatekeepers that could allow data interception.

    Alternative: Use built-in Android features instead of third-party utilities. For example, in Android 12+ an option appeared Allow background activity in the settings of each application. Find it in the section Battery โ†’ Background activity.

    6. Features of working with applications for navigation and streaming

    Navigators (Google Maps, Yandex.Navigator, Waze) and streaming services (Spotify, YouTube Music) often suffer from forced closure. There are specialized solutions for them:

    For navigators:

    • ๐Ÿ—บ๏ธ Enable Traffic saving mode in the application settings - this will reduce the load on the processor and reduce the risk of closure.
    • ๐Ÿ“ Use Offline mapsif the network signal is unstable (frequent requests to the server provoke a reset).
    • ๐Ÿ”Š Disable Voice prompts through the speaker (in Google Maps: Settings โ†’ Navigation โ†’ Voice volume โ†’ Via speaker) - this reduces Conflict with other audio applications.

    For music services:

    • ๐ŸŽต In Spotify turn on Autoplay (Settings โ†’ Playback โ†’ Autoplay) so that the tracks are not interrupted.
    • ๐Ÿ“ฑ On Samsung add the player to Gaming mode (Settings โ†’ Device care โ†’ Battery โ†’ More battery settings โ†’ Game mode) - this will prevent optimization.
    • ๐Ÿ”„ B YouTube Music disable Limit mobile dataif you use mobile data (otherwise the application will "fall asleep" with a weak signal).
    ๐Ÿ’ก

    For Yandex.Navigator on Xiaomi be sure to disable MIUI optimization And enable Autostart โ€”otherwise the application will close every 10 minutes.

    ๐Ÿ’ก Helpful advice: If you use the navigator in the car, connect the phone to a charger via quality cable (cheap cables can cause micro-interruptions in power, due to which Android resets applications).

    7. Radical solutions: root, custom firmware and kernels

    If you are ready to take radical measures, root access custom firmware gives complete control over process management. But these methods are only suitable for experienced users.

    What can be done with root:

    • ๐Ÿ› ๏ธ Install Xposed Framework with module Disable Flag Secure to bypass restrictions.
    • ๐Ÿ”ง Use Magisk to modify system files responsible for memory management (lmkd or memtrack).
    • ๐Ÿ“ฑ Install a custom kernel (for example, FrancoKernel), where you can manually configure parameters OOM (Out-of-Memory) Killer.

โš ๏ธ Attention: Installing custom firmware voids warranty and can lead to unstable operation of the device. On some models (for example, Samsung s Knox) root triggers the flag KNOX 0x1, after which it is impossible use Samsung Pay or Secure Folder.

๐Ÿ“Œ An alternative without root: Some custom firmware (for example, LineageOS) allow fine-tune memory management without full root. But installing them still requires unlocking the bootloader, which resets all data.

FAQ: Frequently asked questions about closing applications on Android

Why does Android close applications even when the battery is 100% charged?

Optimizing background processes is associated not only with charge, but also with RAM management. Android kills unused apps to free up RAM for active tasks. This is normal system behavior, but it can be corrected (see the section about Background process limit).

How to check which application is closing my app?

Use adb logcat to monitor logs:

adb logcat | grep -E "kill|am_kill|Force stopping"

Or install Logcat Reader from Google Play. Look for entries with LMKD (Low Memory Killer Daemon) - this is a system process responsible for closing applications.

Will VPN work if it will the process kill the system?

No, the VPN connection will be disconnected. To avoid this:

  1. Add the VPN application to the battery optimization exceptions.
  2. Use a VPN with the function Always-on (for example, ProtonVPN or built-in VPN in Android 7+).
  3. On Samsung enable Network blocking in the VPN settings.

Is it possible to disable optimization for all applications immediately?

Technically yes, but this is highly not recommended. Completely disabling optimization (adb shell cmd deviceidle disable) will lead to:

  • A decrease in battery life by 30-50%.
  • Slowdown of the system due to an overload memory.
  • Overheating of the device.

It is better to configure optimization selectively for critical applications.

Why, after updating Android, applications began to close more often?

With each new version of Android, Google tightens its policy for managing background processes. For example:

  • Android 8.0 (Oreo): limited the background activity of services.
  • Android 9.0 (Pie): introduced App Standby Buckets - classification of applications by frequency of use.
  • Android 12+: added Exact alarm restrictions, due to which some applications cannot run background tasks on a timer.

Check the optimization settings after the update - they could reset.