Fetching ID from Noti.Notify(Id) ?

Mickego

Member
Licensed User
Longtime User
Is it possible to get the Id from a Notification that is Clicked ?

Have Notifications created from a service,
want an Activity started when Clicked on,
and also have the Id Passed to the Activity.

rgds Mickego
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This will be possible in v1.8.
There is a new SetInfo2 method that adds a "tag" parameter. You can later retrieve this value in Activity_Resume (after the user clicks on the notification):
B4X:
Sub Activity_Resume
   Dim in As Intent
   in = Activity.GetStartingIntent
   If in.HasExtra("Notification_Tag") Then
      Log(in.GetExtra("Notification_Tag"))
   End If
End Sub
 
Upvote 0

RiverRaid

Active Member
Licensed User
Longtime User
Hi!

Is it possible to remove/delete the intent in Activity_Resume?
Otherwise, the code will be executed everytime in Activity_Resume (f.i if you turn the phone)

Regards,
Andi
 
Upvote 0
Top