It shouldn't as a service is not an activity. But don't use ExitApplication
No sorry, I did never use this library. As I understand what you are trying to do, you should call the StartActivity(Main) or a better way create a new activity to display your toast message and call it depending on the Main activity's state from your service.
if isPaused(Main) then StartActivity(Display)
and to hide the Display activity
if not(isPaused(Display)) then callsubdelayed(Display,"Quit")
And in the Display activity
Sub Quit
Activity.Finish
End Sub
You will have to create subs and call them using callsub or callsubdelayed of course
Well, I have Notifications and Toasts working properly now. The reason the Toasts weren't appearing was because it's sometimes hard to update my Service Module code as it is so persistent.
I've been implementing the fancy toast message box... so haven't had a chance to try the Activity.Finish.
I'm also grabbing the Package Name of any running App when my Service Module decides to run the Main module (with dimmed screen and transparent background so it just looks like a MsgBox).
Sub GetPackagename AsString
I save the PackageName, and replace that after my Activity has gone back to Background state (the reason that it all works just fine as long as they have a running app when it all happens).
Then, to start it back up I do:
StartActivityIntent = PM.GetApplicationIntent(Main.ProcessGlobalsActivityToRestore)
Try
If StartActivityIntent.IsInitialized Then
StartActivity(StartActivityIntent)
Else
' Didn't return initialized Intent
IfMain.Debugging1 ThenLog("OVERLORD: The " & Main.ProcessGlobalsActivityToRestore & " Activity Can't be re-Loaded")
'StopOverlordAnErrorOccurred = True
IfMain.Debugging1 ThenLog("OVERLORD: Going Home")
GoHOME("")
EndIf
Catch
ToastMessageShow("OVERLORD: Cannot Start " & Main.ProcessGlobalsActivityToRestore,False)
EndTry
==============
To start-up my Activity, as you said I do:
If IsPaused(Main) Then StartActivity(Main)
===============
Sorry for all the extraneous variable names and such. I have five Debugging flags set-up and they help when I'm debugging... but definitely don't when I'm explaining.
