Вопрос

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