How they do? (Service module)

coslad

Well-Known Member
Licensed User
Longtime User
Hi
I have a question, how some program do when the service module is killed with the task manager to reload them self.
I tried with service foreground but when the task manager kill the process it remains killed.
Is it a limit for b4a or there is a way?
Thanks in advance.

Inviato dal mio H9500 con Tapatalk 2
 

derez

Expert
Licensed User
Longtime User
I'm not sure if this is what you want, but you can set the service to restart from the service_start sub by this command:
B4X:
StartServiceAt("", DateTime.Now +  dt ,True)
The service will start after dt time even it has been killed.
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Unfortunately task manager kill the shedulated task, so the only way to restart the service is to reboot the device, cold reboot, becouse with warm reboot sometime the service doesn't start.



Inviato dal mio GT-P7510 con Tapatalk 2
 
Upvote 0
Top