My application need data on sdcard strongly. So i am getting stuck when android phone unmount sdcard, my application will be force close. If my app starts after sdcard is unmounted, i can check and notice out. But when my app is running in background, so user unmount sdcard and back to my app, it's very difficult to check this case. My app has many activity... Any ideal?

有帮助吗?

解决方案

Simple register two BroadcastReceiver for android.intent.action.MEDIA_MOUNTED, android.intent.action.MEDIA_UNMOUNTED. Just detect it and then stop your any function of your program properly. Anyway (Mr. Nguyen Dinh Chien) somehow?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top