Android Question Is it valid for Service_Destroy event to not be called when OS kills service?

JohnC

Expert
Licensed User
Longtime User
I know that the below post about services says "Sub Service_Destroy is called when you call StopService".


But I'm seeing that this Event is not triggered when the OS kills the service under low-memory conditions.

So, is this expected behaivior or is Service_Destroy only gauranteed to be called with just a StopService call?

If this can happen, then I guess my app should not assume any code in this sub will always run when the service stops.
 

JohnC

Expert
Licensed User
Longtime User
Curious, what conditions would decide if the OS would "Stop" vs. "Kill" the service?
 
Upvote 0
Top