Both commands send a message to the message queue. I don't see any good reason to destroy and recreate a service. It sounds to me that you are doing something wrong.
Both commands send a message to the message queue. I don't see any good reason to destroy and recreate a service. It sounds to me that you are doing something wrong.
Thanks @Erel ,
That's because I need to recreate a service in order to restart the Service_Create sub in certain conditions... maybe the follow code should be more elegant:
B4X:
Sub Service_Create
CreateRoutine
end Sub
Sub CreateRoutine
If condition then
do something... ' This code will do something that will turn the condition false sometime, stopping the loop...
...
CreateRoutine
else
StopService(Me)
end if
end Sub
I think that it is a mistake to restart the service. I don't see any good reason for this. If you want to restart something in the service then move the relevant code to a different sub (out of Service_Create) and call it from Service_Create and when you want to restart it.