Hello!
I found several similar threads but not exactly the issue I'm having. My apologies if I'm wrong.
I'm trying to start an activity from a service. It's easy, and it works fine when the activity is closed.
But when the activity is open, and the service starts, the activity closes instead of remaining open. It doesn't happen when the activity I want to open is Main.
This is my (simplified) code:
Main:
The activity I want to open:
The service:
What am I doing wrong?
Thank you very much
I found several similar threads but not exactly the issue I'm having. My apologies if I'm wrong.
I'm trying to start an activity from a service. It's easy, and it works fine when the activity is closed.
But when the activity is open, and the service starts, the activity closes instead of remaining open. It doesn't happen when the activity I want to open is Main.
This is my (simplified) code:
Main:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout1")
End Sub
Sub Button1_Click
StartServiceAt(StActSrv,DateTime.Now+10000,False)
End Sub
Sub Button2_Click
StartActivity(StAct2)
End Sub
The activity I want to open:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout2")
End Sub
The service:
B4X:
Sub Service_Start (StartingIntent As Intent)
StartActivity(Main)
End Sub
What am I doing wrong?
Thank you very much