I have a service that I want to make a Foreground service. My service has no need to communicate to the user. The simplest example I have seen in this forum is to put this code in the service...
Notification notification = new Notification();
startForeground(5481, notification);
I have seen a much more complicated example in the Commonsware book pp 606 that uses a Notification Builder (NotificationCompat.Builder). This and other examples have a need to provide complex notifications. I don't have this need.
I understand that, for my software to be acceptable, I must at a minimum display an icon that makes the user aware that my service is running and give the user a way to cancel it. Also If my service decides to stop on it's own, the icon should go away. But that's it. That's all I need to do.
What would I have to add to the above tode to accomplish that? thanks, Gary