Is it possible to intercept a phone shutdown event or perhaps use a different hack around this? I have an always running service that\'s part of a non-market application whi
Build a broadcast receiver at catches the ACTION_SHUTDOWN intent.
In the onReceive() method you can accomplish what you are trying to do.
http://developer.android.com/reference/android/content/Intent.html#ACTION_SHUTDOWN
You could try registering a Shutwdown hook using the Runitme addShutdownHook(Thread hook) method.
Aditionally the method reference states:
If runFinalizersOnExit(boolean) has been called with a true argument, garbage collection and finalization will take place after all hooks are either finished or have failed. Then the VM terminates.
So, theoretically the VM won't terminate until your thread finish.