Frage

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?

War es hilfreich?

Lösung

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?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top