Pregunta

Since upgrading to Android 4.3, my application is displaying a persistent system notification:

[My App] is running; Touch for more information or to stop the app

It reads:

[My App] is running
Touch for more information or to stop the app

Why is it there, and what can I do about it?

¿Fue útil?

Solución

This behavior is triggered by applications (ab)using Service.startForeground().

The idea behind using startForeground() is that you provide a notification through which users can interact with your app while it is running. For instance, if it's a music player, make sure you're providing the persistent notification as a parameter of the function, so that Android knows the user already has a way of letting your app invoke stopForeground().

You can basically see this as "public shaming", because apps should behave nicely on the platform and let the system kill them if it needs to.

(In my case, the culprit was actually Robospice; here's the line in question and the associated issue.)

Otros consejos

If you device is rooted you can hide these notifications using GravityBox using the Xposed Framework.

In GravityBox go to Statusbar tweaks >> Ongoing notification blocker >> Select which to block >> Ok After a device reboot those notifications will be gone.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top