My sample is in attached. I have 2 activities in the sample: Main and Tips.
The button in the main activity close the app and start a notification.
I want to do this:
If the user presses on the notification, open the Main activity and show the Tips activity (it's OK).
The Tips activity is started only if the user press the notification.
If him start the app from tap in the icon or start from the recents apps list, the app do NOT show the Tips activity.
I tried several codes from the forum, but my code don't works.
If I restart the app from the recents apps list, the Tips activity is started again.
How can I fix it?
Thanks in advance for any tips.
Sub Globals
Dim in As Intent
End Sub
Sub Activity_Create(FirstTime As Boolean)
in = Activity.GetStartingIntent
If (in <> Starter.GlobalIntent) Then
Starter.GlobalIntent = in
'Start the tips activity only the app start from click in notification
If in.HasExtra("Notification_Tag") And (in.GetExtra("Notification_Tag") = "odNotify") Then
StartActivity(tips) 'I do not want to open the Tips activity if the app is opens through the list of recent apps
End If
End If
Activity.LoadLayout("layMain")
End Sub
Sub Button1_Click
StartNotification
Activity.Finish
End Sub
Sub StartNotification
Dim n As Notification
n.Initialize2(n.IMPORTANCE_HIGH)
n.Icon = "icon"
n.AutoCancel = True
n.Vibrate = False
n.Sound = True
n.SetInfo2("Hello", "Tip of day", "odNotify", Me)
n.Notify(1)
End Sub