How to fix the application in the background on Xiaomi: a complete guide for MIUI

Why Apps Close in the Background on Xiaomi and How to Fix It

Xiaomi smartphone owners often face a problem: instant messengers like WhatsApp or Telegram suddenly shut down, music is interrupted, and games lose progress when switching between tasks. The blame is the aggressive optimization of the battery in the shell of MIUI, which forcibly closes the background processes. But the good news is that this problem can be solved without root rights or complex manipulation.

In this article, we will discuss 5 working ways to fix the application in the background on Xiaomi, including hidden settings MIUI 14, work with auto-run and even bypassing restrictions through ADB. The methods are tested on models from Redmi Note 10 to Xiaomi 13 Ultra and are relevant for all versions of firmware after MIUI 12. Importantly, some parameters may differ depending on regional firmware (Global, China, EEA).

Before you start, make sure you have the latest version of MIUI installed. Check this out at Settings β†’ About Phone β†’ System Update. If an update is available, install it, as newer versions often fix bugs with background processes.

πŸ“Š What Xiaomi model do you use?
Redmi Note 10/11/12
Xiaomi 11/12/13
POCO F3/F4/F5
Redmi 9/10/11
Another model

Method 1: Blocking memory cleanup for an application

The simplest and most effective method is to add an application to the clean-out-proof list, which prevents the system from automatically closing the program when there is a shortage of RAM.

Instructions:

  • πŸ“± Open the phone settings.
  • πŸ” Go to the Apps β†’ Application management.
  • πŸ“Œ Find the app you want (like Viber or Spotify) and tap it.
  • πŸ”’ Select Cleanup Lock (or Lock in Recents in English version).
  • πŸ”„ Restart your phone to apply changes.

After that, the application will appear in the recent panel with the lock icon. πŸ”. It won't shut it down even if it's running out of memory. Note: this method doesn't work for all applications -- some system services (like Google Play Services) can't be blocked.

Close all background applications

Check free RAM (in Settings β†’ About Phone β†’ Memory)

Turn off the power saving mode

Restart your phone after changing your settings-->

Method 2: Setup autostart and background activity

MIUI limits the autorun of apps by default to save battery life, but for instant messengers and services like YouTube Music, it's critical that without autorun, they won't be able to run in the background. Let's fix that.

Steps:

  1. Go to Settings β†’ Applications β†’ Application Management.
  2. Click on the three dots in the top right corner and select AutoRun.
  3. Find the right app and turn on the switch next to it.
  4. Go back and select Background Activity (or Battery β†’ App Battery Saver in some versions).
  5. Set the application mode without restrictions.

Some applications (such as Google Maps or Waze) will also need to allow precise location access in the background. β†’ Confidentiality β†’ Permits β†’ Location.

What to do if there is no "Stop" item?
In some regional firmware (for example, MIUI EEA) This item is hidden. To get it back, execute a command through ADB: adb shell settings put global hidden_api_policy 1 Then restart your phone and check if you have the option.

Method 3: Optimizing the battery for background processes

By default, MIUI limits the background activity of all applications except system ones, and in order for messengers and music services to work consistently, you need to manually configure exceptions.

How to do this:

  • πŸ”‹ Go to Settings. β†’ Battery and performance β†’ Managing battery consumption by applications.
  • πŸ” Select an app from the list (e.g. Telegram).
  • πŸ› οΈ Set the mode without restrictions.
  • πŸ”„ Repeat for all critical applications.

For models with MIUI 14, the path may be different: Settings β†’ Battery β†’ Power Saving Mode β†’ Settings β†’ Battery Management. If you don’t find the right item, try searching by settings (the magnifying glass icon in the upper right corner).

πŸ’‘

After changing the battery settings, do a soft reset of the phone: press the power button for 10 seconds before restarting, which will help the system to correctly apply the new parameters.

Method 4: Using ADB for deep optimization (for advanced)

If standard methods don't work, you can use the Android debugging bridge (ADB), which requires connecting your phone to your computer, but gives you maximum control over the background.

Step-by-step:

  1. Turn on Developer Mode on your phone: Settings β†’ About Phone β†’ MIUI version (shap 7 times).
  2. Activate USB Debugging in Settings β†’ Additional β†’ For developers.
  3. Connect your phone to your PC and execute the commands: adb shell dumpsys deviceidle whitelist +com.example.app adb shell cmd appops set com.example.app RUN_ANY_IN_BACKGROUND allow you to replace com.example.app with a real application package (e.g. org.telegram.messenger for Telegram).

Important: once MIUI is updated, all ADB changes are reset, and you have to re-apply them, and this is a good method for power users, because the wrong commands can disrupt the stability of the system.

πŸ’‘

ADB-commands give the most control over background processes, but require re-use after each major update MIUI.

Method 5: Alternative solutions for stubborn applications

If none of these methods worked, try these workarounds:

Problem.DecisionExample of applications
The application closes when the screen is blockedDisable battery optimization for Android System and Google Play ServicesPokΓ©mon GO, Harry Potter: Wizards Unite
Music interrupts in headphonesTurn on Absolute Sound in Bluetooth settingsSpotify, YouTube Music
Messengers do not receive notificationsTurn off the Adaptive Battery in the Battery SettingsWhatsApp, Viber, Signal
Games are losing progressUse Game Turbo to force the game to be stored in memoryGenshin Impact, PUBG Mobile

For some applications (like Facebook or Instagram), installing modified versions via Xiaomi GetApps or APKMirror can help.These versions are often optimized to run on MIUI.

πŸ’‘

If you are using a POCO Launcher or a Third-party launcher, some background process settings may be reset, in which case, return to the standard MIUI launcher for changes.

Common Mistakes and How to Avoid Them

Many users make common mistakes when setting up background processes.

⚠️ Warning: Don't turn off battery optimization for all applications in a row, it will cause the battery to run out quickly and the device to overheat. Only choose programs that really need background work.

Other frequent mistakes:

  • ❌ Using killer tasks (such as Greenify) together with blocking cleaning is in conflict with system settings.
  • ❌ Resetting battery settings via ##4636## without need – this can impair battery life.
  • ❌ Installation of incompatible versions of applications (for example, APK Android 12 on MIUI 13).

If after all the manipulations the application is still closed, check it for viruses using Google Play Protect or Dr.Web. Some malware masquerades as legitimate services and interfere with the normal operation of the system.

FAQ: Frequent questions about background processes on Xiaomi

Why did all background process settings reset after the MIUI update?
This is standard MIUI behavior, when major updates (e.g., MIUI 13 to MIUI 14) are made, the system resets the user's battery optimization and auto-start settings. You'll have to reconfigure everything. To avoid this in the future, back up the settings through Settings β†’ Additional β†’ Backup and Reset.
Can system applications (such as Camera or Phone) be fixed in the background?
No, Xiaomi system applications cannot be blocked in the background through standard settings. They are managed at the firmware level and automatically optimized by the system. If you want, for example, to make Screen Recording work smoothly, try using third-party applications like AZ Screen Recorder.
How to check which apps consume the most batteries in the background?
Go to Settings β†’ Battery β†’ Battery usage. This shows a list of apps with percentage of consumption. Tap on any item to see detailed statistics, including background consumption and activity time.
Will the cleaning lock work if I use Second Space?
No, the cleanup and autorun lock settings are applied separately for each space, so if you switch between the Main Space and the Second Space, you'll have to adjust the background processes for each space independently.
Can I turn off battery optimization completely?
Technically, but it's not recommended. Completely shutting down optimization will result in: 30-50% less battery life; overheating of the device under heavy load; Slowing down of the system due to overloaded RAM; It's better to customize exceptions selectively only for critical applications.