I want to let the user safely remove the SD card in my program, but it seems the Android 2.2 public API does not provide a way to do this. Does anyone know what's a proper way to do it?
1 Open the My Files app. Note: On older devices you'll need to first select All Files and then select the SD Card option. Note: To delete files or folders, long press on the item you wish to remove, and select the Delete option in the top right of the screen.
You need to take the user to the device's built-in Settings. I think this will work.
Intent i = new Intent(android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS);
startActivity(i);
Unmounting the SD card is one of those actions which could be used maliciously if it wasn't under full user control. If it could be done purely in software (without user intervention) then code could disrupt other apps running on the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With