How to cleanly exit an external app when the sd-card gets unmounted?
my app includes a service, and I'm looking for a way to gracefully exit when the app is installed on th开发者_StackOverflowe sd-card, and that the sd-card gets unmounted. I don't need the service to restart after the sd-card gets mounted again. I just need to release some files/resources, etc..
I thought about listening for Intent.ACTION_MEDIA_EJECT, but this is apparently broadcast after the external apps have been forced to exit.
Any solution?
精彩评论