Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persistent notification of running app on Android 4.3

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?

like image 521
Paul Lammertsma Avatar asked Jul 29 '13 14:07

Paul Lammertsma


People also ask

How do I get rid of persistent notifications on Android?

First, press-and-hold on the persistent notification you want to remove. Another option is to swipe the notification left or right, and then tap on the cogwheel icon shown next to it. Next, tap on the switch next to Permanent to disable it, and then press Save.

What is Android persistent notification?

Persistent notifications are passive notifications and do not require interaction from the user and are usually triggered to keep the users informed about their activity inside the app once they move away from it. Google removed the ability to dismiss persistent notifications, but these might reappear with Android 11.

How do I make notifications persistent?

On the Notifications screen, scroll down and tap on the particular App for which you want to enable persistent notifications. 4. On the App's notification settings screen, scroll down to the bottom of the screen until you see two phone icons labelled as “Temporary” and “Persistent”.


2 Answers

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.)

like image 61
Paul Lammertsma Avatar answered Nov 11 '22 01:11

Paul Lammertsma


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.

like image 32
Stormenet Avatar answered Nov 11 '22 02:11

Stormenet