Android Question Notification with NB6 and progressbar

Nickelgrass

Active Member
Licensed User
Longtime User
Hello,
how can I update the progressbar in a notification that was built with NB6?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
how can I update the progressbar in a notification that was built with NB6?
You need to replace the Notification with a new one. See the Example-Prroject

B4X:
Sub Notification_WithProgress
    Dim notif As Notification
    For i = 1 To 10
        Dim n As NB6
        n.Initialize("default", Application.LabelName, "DEFAULT").SmallIcon(smiley)
        n.Progress(i, 10, False)
        n.OnlyAlertOnce(True)
        notif = n.Build("Title", "Content", "tag", Main)
        notif.Notify(6)
        Sleep(500)
    Next
    notif.Cancel(6)
End Sub
 
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
Hello,
this basically works. The problem is that my phone now switches the screen on to display the "new" notification each time the notification is updated and the screen is off. Is there any way to prevent this? Means is there no posibility of updating the old notification instead of notifying a new one?

Solved: by setting visibility to secret.
 
Upvote 0
Top