Kiradev
Kiradev

Reputation: 347

android application only run when sdcard is avaiable

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?

Upvotes: 0

Views: 204

Answers (1)

Pete Houston
Pete Houston

Reputation: 15079

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?

Upvotes: 1

Related Questions