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?
Asked
Active
Viewed 200 times
0
-
1Does this really happen often? What is your app doing in the background on the sdcard anyway? Is it some kind of long-time running background daemon? It sounds like you may be doing something manually through a background service that could be done automatically through the event-based Android API instead. – Stephan Branczyk Aug 05 '12 at 03:01
1 Answers
1
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?

Pete Houston
- 14,931
- 6
- 47
- 60
-
Thanks. that's right solution really. But i had solved it by my another way. And on the same occasion, anybody knows how to make android knows this app need sdcard strongly, i saw some app are diable when sdcard is unmounted. (I tried installlocation: preferExternal, so my app is disable when sdcard unmount, but i need widget so i can't install it on external memory) – Kiradev Aug 07 '12 at 01:31