문제

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