counter
is not a reference; the notification will not update with its new value until you explicitly tell it to.
Have a look at the documentation on updating an existing notification. Your ID is 1337
here, so you can use that to update it.
In fact, you may just be able to call declareNotification()
again from your onTick()
method... If this doesn't work, however, I would suggest keeping a reference to the Notification
object (as a member variable), then updating it, and use nm.notify(1337, /* your notification object */);
.