开发者

How to cleanly exit an external app when the sd-card gets unmounted?

开发者 https://www.devze.com 2023-02-02 08:34 出处:网络
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

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号