I don’t want the SD Card to be removed by user when my application is running, as it will contain the database I would be using in my application for displaying images and information from it.
Possible solutions as I see can be to copy the contents of the Database in SD card into the application at the start of the application (but it might consume time).
Is there any particular way by which I can freeze my application when the SD-Card is removed ?
Thanks for your help in advance !
Cheers,
Sumit
How about don’t have the database on the SD card in the first place? If you are downloading it, download it directly to internal storage. If it is inside the APK as an asset or resource, extract it to internal storage.
If you need to use external storage (SD card), check if external storage is mounted when the app starts. If it is not, display an appropriate message and finish the activity.