Guide
Music stops when the screen turns off? Here's the fix
You lock the phone, put it in your pocket, and a few minutes later the music stops. The player didn't crash. The phone closed it to save battery. These settings stop that, for any music app.
Why it happens
Android lets a music app keep running with the screen off, as long as it shows a playback notification. Many phone makers add their own battery savers on top. Those savers close background apps after a while, even ones that are playing music. Xiaomi, Redmi and POCO phones (HyperOS and MIUI) are among the strictest. Some Samsung, Huawei, Oppo, Vivo and OnePlus models do it too.
Menus move around between phone models and software versions, so the names below may differ slightly on yours. Search for the setting name in the Settings app if it's not where we say.
Xiaomi, Redmi and POCO (HyperOS and MIUI)
Go to Settings, Apps, Manage apps and pick your music player. Then:
- Autostart: turn it on. Without it, the phone can stop the app from restarting its playback service.
- Battery saver (sometimes just Battery): choose No restrictions.
- Pause app activity if unused: turn it off, so the phone doesn't freeze the app or take its permissions away when you haven't opened it for a while.
- Lock it in Recents: open the recent apps screen, long-press the player's card and tap the lock icon. Clearing recent apps then leaves it alone.
Samsung (One UI)
- Settings, Battery, Background usage limits: add the player to Never sleeping apps, and make sure it's not in Sleeping or Deep sleeping apps.
- In the app's own page (Settings, Apps, then the player), set Battery to Unrestricted.
Other Android phones
- Open the app's page in Settings, Apps.
- Set App battery usage (or Battery optimisation) to Unrestricted or Don't optimise.
- Turn off Pause app activity if unused.
- Allow the app's notifications. On Android 13 and later, the playback notification is how the phone knows music is playing.
Check that it worked
Start some music, lock the phone and leave it for at least five minutes without touching it. If the music is still going, the settings took.
The shortcut in Flex Music Player
Flex Music Player was developed on a Xiaomi phone, and we didn't want anyone to have to hunt for these settings. In the app, open Settings, Keep playing. Each step has a button that opens the right settings screen directly, ticks itself off once it's done, and then a Test it button plays music muted for five minutes with the screen off and tells you whether it survived. If the phone still closes the app, Flex Music Player remembers the song and the exact spot, so you lose nothing.