logy
logy

Reputation: 29

Android - Update a notification every time that changes the value of the variable

I have a small notification application which view a variable "int a" into status notification. At the time when I start the application, the value of the variable is taken and displayed in the status bar. Since this variable varies continuously (approximately every 1-2 minutes), can you tell me how can I do so that the status bar automatically updates the value of this variable to avoid having to reload each time the application? I hope I was clear. thanks A.

Upvotes: 1

Views: 230

Answers (1)

Booger
Booger

Reputation: 18725

You will just need to send a new notification that contains the new int value.

Just make sure to set the Flag Notification.FLAG_AUTO_CANCEL, which will replace your existing notification, with the new one you are sending.

Upvotes: 0

Related Questions