M Mickego Member Licensed User Longtime User Jan 11, 2012 #1 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
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 Jan 12, 2012 #2 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): Code: Copy 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
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): Code: Copy 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
R RiverRaid Active Member Licensed User Longtime User Apr 15, 2012 #4 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
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
Erel B4X founder Staff member Licensed User Longtime User Apr 15, 2012 #5 You can store the intent object as a global variable. Then in Activity_Resume test whether GetStartingIntent = storedIntent. If yes then you know that this intent should be ignored. Upvote 0
You can store the intent object as a global variable. Then in Activity_Resume test whether GetStartingIntent = storedIntent. If yes then you know that this intent should be ignored.