Android Question NB6 notification question: getting the contenttext upon deletion

giggetto71

Active Member
Licensed User
Longtime User
hi,
I have a working nb6 notification and I can get the deete action intent event. is there a way there, to get the notification contetenttext of the notification being deleted by the user? or any other info set in the build method when I created the notification?
thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add NB6 class from the library to your project and add this sub to that class:
B4X:
Public Sub DeleteAction2 (Service As Object, Action As String, Extra As String) As NB6
    If IsBuilder Then
        Dim in As Intent = CreateIntent(Service, True)
        in.Action = Action
        in.PutExtra("my_extra", Extra)
        NotificationBuilder.RunMethod("setDeleteIntent", Array(PendingIntentStatic.RunMethod("getBroadcast", Array(ctxt, 1, in, GetPendingIntentFlag))))
    End If
    Return Me
End Sub

It will allow you to add extra information to the delete intent.

Untested...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…