I have a long running service, which may have the user in another section of the application. I wish to show the current state of the service on the activity the user is currently in. Attached is an example project simplification of my issue.
If I start the service while in either Activity and stay within that Activity, it all works fine. However, if I switch to the other activity, the app appears to stall.
I have given the service the following logic to know which activity is currently visible:
Where ActivityIndex can be 1, 2 or 0 if its in the process of switching between activities.
I can not see where I am going wrong?
If I start the service while in either Activity and stay within that Activity, it all works fine. However, if I switch to the other activity, the app appears to stall.
I have given the service the following logic to know which activity is currently visible:
B4X:
If Globals.ActivityIndex = 1 Then
CallSub3(Main, "ShowText", I, P)
Else If Globals.ActivityIndex = 2 Then
CallSub3(SecondActivity, "ShowText", I, P)
End If
I can not see where I am going wrong?