Hide Service Notification

surfuric

Member
Licensed User
Longtime User
I need my service to not shut down so I am using:
Service.StartForeground(1,n) where n is the notification I have set up.
This works well, but my users hate the icon in the notification bar.
So I changed:
n.icon = "icon"
to
n.icon = "" and now there is no notification in the ongoing section AND there is no icon in the notification bar at the top. Exactly what I want.

But . . . is this the correct way to run a service in the background, keep it alive even in low mem situations, and also hide the icon?

(I read that I should instead set the icon to a transparent icon, but have not run across the code to do so. If I need to do that instead, would someone please give me the code snippet for that?)

Thanks!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…