Hi,
I have a service (called MyService) and I have many Activitys.
One of the Activitys will create & start the service, but I want to be able to use all my Activitys to call a sub within it.
I have used the following code but there might time to time where the service might not be created yet but my code still wants to call the sub in the service.
Lets say the above code was sent from Activity5 but Activity1 might be the Activity that actually creates/starts the service. There might be a time where Activity1 is never opened so the service is never created.
Calling the above call then fails since the service is not created/started.
Is there a way to check to see if the service has started or been created from a Activity so that I know to call the sub or not?
I have a service (called MyService) and I have many Activitys.
One of the Activitys will create & start the service, but I want to be able to use all my Activitys to call a sub within it.
I have used the following code but there might time to time where the service might not be created yet but my code still wants to call the sub in the service.
B4X:
CallSub2("MyService","TheSub")
Lets say the above code was sent from Activity5 but Activity1 might be the Activity that actually creates/starts the service. There might be a time where Activity1 is never opened so the service is never created.
Calling the above call then fails since the service is not created/started.
Is there a way to check to see if the service has started or been created from a Activity so that I know to call the sub or not?