I have a service that I want to do for the Foreground service. My service does not need to communicate with the user. The simplest example I've seen on this forum is to put this code in a service ...
Notification notification = new Notification(); startForeground(5481, notification);
I saw a much more complex example in Commonsware pp 606, which uses Notification Builder (NotificationCompat.Builder). This and other examples require comprehensive notifications. I do not have this need.
I understand that in order for my software to be acceptable, I must at a minimum display an icon that informs the user that my service is running, and allow the user to cancel it. Also, if my service decides to stay on it, the icon should disappear. But it is so. That is all I need to do.
What should I add to the above tode to do this? thanks gary
source share