B4X:
Dim n As NB6
n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(smiley)
n.Build(quot.Get("sms"), "Kabojja Junior School", "tag", Sendsms).Notify(9)
Dim n As NB6
n.Initialize("default", Application.LabelName, "HIGH").SmallIcon(smiley)
n.Build(quot.Get("sms"), "Kabojja Junior School", "tag", Sendsms).Notify(9)
Sub Activity_Resume
Dim in As Intent = Activity.GetStartingIntent
If in.IsInitialized And in <> OldIntent Then
OldIntent = in
If in.HasExtra("Notification_Tag") Then
Log("Activity started from notification. Tag: " & in.GetExtra("Notification_Tag"))
End If
End If
End Sub
Did you look at the example Erel provided in the NB6 thread? (https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/)
You use the tag parameter in the n.Build call (in your case "tag") to pass the value, then you get it by calling HasExtra("Notification_Tag") in the Activity_Resume of the activity that you defined in the n.Build call (in your case Sendsms).
This is what i have put on my sendsms but now how to get the contents from my notification and how can i define the oldintent as seen in your example
- Colin.B4X:Sub Activity_Resume Dim in As Intent = Activity.GetStartingIntent If in.IsInitialized And in <> OldIntent Then OldIntent = in If in.HasExtra("Notification_Tag") Then Log("Activity started from notification. Tag: " & in.GetExtra("Notification_Tag")) End If End If End Sub
Dim in As Intent = Activity.GetStartingIntent
'If in.IsInitialized And in <> OldIntent Then
'OldIntent = in
If in.HasExtra("Notification_Tag") Then
Log("Activity started from notification. Tag: " & in.GetExtra("Notification_Tag"))
End If
'End If
i have finally got it please thanksDownload the example app attached to the first post in the thread I referenced in my reply. It shows you exactly how to do what you want. I'm not going to write your code for you (unless you're offering me a job of course!).
- Colin.