Android Question Restart a service

wl

Well-Known Member
Licensed User
Longtime User
Hi,

My app runs a service and in some cases it need to stop the service and restart it.

I do this by (code in the service):

B4X:
StartServiceAt("Service_Main", nextConnectAt, True)
StopService("")
where nextConnectAt would tradionally be a second in the future.

Could it be a problem that service has not yet fully stopped before it was scheduled to restart ?
And also: would it be better to first stop and then schedule the restart ?

Or: would it be better to reschedule the service in the Service_Destroy ?

Thanks !
 

wl

Well-Known Member
Licensed User
Longtime User
Thanks NJDude,

I was jut wondering if there could be an impact that I restart the exact same service from within this servcice before it was fully destroyed.

Thanks
 
Upvote 0
Top