How unmount programmatically USB DRIVE in Android 4.2
问题 I have read many posts on this topic, but I have not found a solution yet. In my application I need to unmount the USB DRIVE after copying files from USB DRIVE to the tablet, so I can safely remove it without using the Settings menu. Right now I am using this method: Utility.copyDirectory(file,new File(_CURR_FOLDER)); Process su; su = Runtime.getRuntime().exec("/system/bin/su"); String cmd = "umount" + " " + SDPath + "\n" + "exit\n"; su.getOutputStream().write(cmd.getBytes()); What I get in