Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private OldIntent As Intent
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Simple_Notification
End Sub
Sub Activity_Resume
Dim in As Intent = Activity.GetStartingIntent
If in.IsInitialized And in <> OldIntent Then
OldIntent = in
Dim intentExtra As String
Log("Intent="&in)
Log("Intent="&in.GetData)
Log("Intent="&in.ExtrasToString)
'Log("Intent="&in)
If in.HasExtra("Notification_Tag") Then
intentExtra = in.GetExtra("Notification_Tag")
Log("XTRA="&intentExtra)
Dim jp As JSONParser
jp.Initialize(intentExtra)
Dim root As Map = jp.NextObject
Dim Title As String = root.Get("title")
Dim Body As String = root.Get("body")
Dim other As String = root.Get("other")
Log("The Title is: "&Title)
Log("and the Body: "&Body)
Log("and the other value: "&other)
End If
End If
End Sub
Sub Simple_Notification
Private smiley As Bitmap
smiley = LoadBitmapResize(File.DirAssets, "smiley.png", 24dip, 24dip, False)
Dim m As Map = CreateMap("title":"Title here", "body": "Body here","other":"Another value") ' Define the map you want to get from the notification....
Dim jg As JSONGenerator
jg.Initialize(m) ' Add the map to the jsogenerator
Dim n As NB6
n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(smiley)
n.Build("This is the title or what", "Content is here", jg.ToString, Me).Notify(4) ' Note the jg.tostring as TAG
End Sub