How to update time of an Android notification
You're probably looking for NotificationCompat.Builder#setWhen(long)
. Supplying it with System.currentTimeMillis()
should update the timestamp to the current time.
In addition if you want that timestamp to appear on Android N or higher, you need to call NotificationCompat.Builder#setShowWhen(true)
at some point because it defaults to false.
Source: https://developer.android.com/reference/android/app/Notification.html#when