How to force a service restart?
I have a background service that sometimes gets killed by the OS when it is running low on memory. How to simulate this behaviour so I can debug it? The dev guide simply says "if your service is started, then you must design it to gracefully handle restarts by the system. If the system kills your service, it restarts it as soon as resources become available again". What's the sequence of calls from when it gets killed to when it finishes restarting? On a side (related) question, what happens to an actively running AsyncTask started in the service when the service gets killed by the OS, i.e.,