I have a foreground service setup in Android. I would like to update the notification text. I am creating the service as shown below.
How can I update the notifica
here's the code to do so in your service. Create a new notification, but ask notification manager to notify the same notification id you used in startForeground.
Notification notify = createNotification();
final NotificationManager notificationManager = (NotificationManager) getApplicationContext()
.getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
notificationManager.notify(ONGOING_NOTIFICATION, notify);
for full sample codes, you can check here:
https://github.com/plateaukao/AutoScreenOnOff/blob/master/src/com/danielkao/autoscreenonoff/SensorMonitorService.java