How to restart a service killed by os?

cb56

Member
Licensed User
Longtime User
How can I do to restart a service killed by OS?

I use StartForereground but it seems that sometimes (rarely) the service is also killed by OS (or mybe an error in the service?).

Do you know if Service_Destroy sub fires if the service is killed by OS or if the service is in error?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is no guarantee that Service_Destroy will be called.

I use StartForereground but it seems that sometimes (rarely) the service is also killed by OS (or mybe an error in the service?).
If you can reproduce it then check the logs to find out why it got destroyed. Foreground services have the highest priority after the current visible process.
 
Upvote 0
Top