Android Question Does StartServiceAt need to be in the same service's Service_Start Sub?

JohnC

Expert
Licensed User
Longtime User
This page mentions to place a "StartServiceAt()" call in a service's "Service_Start" Sub:


Is there any particular reason why it has to be in the Start_Activity sub?

I ask because my service does some operations (outside of the Start_Activity sub) which will determine what time the service should be scheduled to run again, and then later do a StartServiceAt() in a sub that is NOT the Service_Start sub - in fact, the StartServiceAt call might be in a different service all together.

So, is there some reason a StartServiceAt should be in the Start_Activity - for example would it increase the reliability that the service will in fact run at the scheduled time?
 

hatzisn

Expert
Licensed User
Longtime User
If there is a trigger f.e. an event that will be triggered and call the StartServiceAt I suppose there is not. You will have to think though that the services are killed occasionally and this might interrupt the proper functioning of the service.
 
Upvote 0
Top