Hi. I don't know what I'm doing wrong.
I'm trying to show a notification from my app and want to return to my app when I close the notification, but the app is closed instead.
Here's my code:
Main:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout1")
End Sub
Sub Button1_Click
Dim NB As NotificationBuilder
NB.Initialize
NB.AutoCancel=True
NB.ContentText="Prueba"
NB.ContentTitle="Prueba"
NB.Tag="Hola"
NB.DefaultSound=True
NB.DefaultVibrate=True
NB.DefaultLight=False
NB.setCustomLight(Colors.ARGB(255,255,0,255),800,400)
NB.setActivity(Notificacion)
NB.SmallIcon="icon"
NB.Notify(0)
End Sub
Notification:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayNotif") 'Nothing special on this layout: Just a label
End Sub
All hidden subs (Resume, Pause...) contain no relevant code (they're void in this example)
My log shows:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true ** (Now is when I open the notification)
** Activity (notification) Create, isFirst = true **
** Activity (notification) Resume **
** Activity (notification) Pause, UserClosed = true **
I thought a new ** Activity (main) Resume ** should appear at the end, and the main activity should be shown again, but obviously I'm mistaken. How can I do it happen?
Thank you
NOTE: In my actual app (not in this example) I actually don't know what activity is open, as the notification is called from a service, so I want to return from the notification to the last open activity