Android Question Detecting when a notification NB6 is dismissed by the user?

Erel

B4X founder
Staff member
Licensed User
Longtime User
You need to add a DeleteAction.
This code is from the NB6 example:
B4X:
Sub Notification_WithActions
    Dim n As NB6
    n.Initialize("default", Application.LabelName, "DEFAULT").SmallIcon(smiley)
    n.AddButtonAction(smiley, "Action 1", MyService, "action 1")
    Dim cs As CSBuilder
    n.AddButtonAction(Null, cs.Initialize.Color(Colors.Red).Bold.Append("Action 2").PopAll, MyService, "action 2")
    n.AddButtonAction2(Null, "Activity", Activity2, "Test")
    n.DeleteAction(MyService, "delete action")
    n.Build("Actions", "Actions", "tag", Main).Notify(1)
End Sub
 
Upvote 0
You need to add a DeleteAction.
This code is from the NB6 example:
B4X:
Sub Notification_WithActions
    Dim n As NB6
    n.Initialize("default", Application.LabelName, "DEFAULT").SmallIcon(smiley)
    n.AddButtonAction(smiley, "Action 1", MyService, "action 1")
    Dim cs As CSBuilder
    n.AddButtonAction(Null, cs.Initialize.Color(Colors.Red).Bold.Append("Action 2").PopAll, MyService, "action 2")
    n.AddButtonAction2(Null, "Activity", Activity2, "Test")
    n.DeleteAction(MyService, "delete action")
    n.Build("Actions", "Actions", "tag", Main).Notify(1)
End Sub
Thank you so much!
 
Upvote 0
Top