I have a notification that is periodically updated after a certain period of time. The Foreground
service is also associated with it, so it is constantly displayed. When updating data, I must recreate the notification with new ones, using the NotificationManager
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notification.setContentText("Updated Text");
notificationManager.notify(NOTIFY_ID, notification.build());
When using this method, each time a notification arrives, it is displayed as new on the lock screen, and sound and vibration appear when it is received. But I would like to get rid of this.
Is it possible to do that the data is updated already in the existing notification, without the need to recreate it? For example, how this is done in a weather application, where the data is regularly updated directly in the current notification: Notification Widget
Edit
I apologize for my inaccuracy. As it turned out, I am changing the old notifacation, thanks to @0X0nosugar for hint. I use the same ID for notification updating, but every second I get sound and vibration, as well as a continuous message on the lock screen that I have a new notification. Although I do not receive new ones, I am changing the same old notification.
A notification from my application constantly comes to the lock screen. However, this is not observed in the weather application. And I got this