Hello,
I have a doubt. I'm scheduling a service to start every 30 seconds, but I don't need the service running between the intervals... then, I use the code...
Of course that if I check between the intervals if the service is running (using IsPaused(service)) then I'll have true (for pause). But how can I know if the service is scheduled? And if I start again, even if scheduled, I'll have two scheduled instances or the system will respect the last call and cancel any scheduled time for the service?
I have a doubt. I'm scheduling a service to start every 30 seconds, but I don't need the service running between the intervals... then, I use the code...
B4X:
Sub Service_Start (StartingIntent As Intent)
do everything...
StartServiceAt("",DateTime.Now + 30000,True)
StopService("")
End Sub
Of course that if I check between the intervals if the service is running (using IsPaused(service)) then I'll have true (for pause). But how can I know if the service is scheduled? And if I start again, even if scheduled, I'll have two scheduled instances or the system will respect the last call and cancel any scheduled time for the service?