if I start a service with startForeground(myID, not), can I replace the not for another one without stopping the foreground process? I mean, I have a service that will do two task in a row before service ends, and I want to notify user when the first ends without the need to stop foreground Service?
Also, is it possible to start a foreground service with no notification (i.e. NULL).
any stretegy I can use instead of? thanks.
The general answer to your question is to use the NotificationManager.notify() method using the same id passed into the startForground() method when starting the service.
Also worth noting :
Refer to the answer given by Luca and the discussion under CommonsWare's answer, as well as the answers given in by Lorne Laliberte and dmmh.
How do I update the notification text for a foreground service in Android?
Does updating a Notification remove a Service's foreground status?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With