In my splash screen, I want to check if the phone has a SDCard. The Boolean statement is beneath:
Boolean isSDPresent = android.os.Environment.getExternalStorageState()
.equals(android.os.Environment.MEDIA_MOUNTED );
So, if I have the SDCard in the slot on my phone, this boolean will return true, so far so good. When I go to the "Unmount SDCard" from the settings menu, and removes the SDCard, then kill the app and launching it again, the boolean will also be true..
And if I launches the Astro File Manager
after unmounting and removing the sdcard, I can still access the /mnt/sdcard
path, why?
How can I manage to accomplish this?
Thanks in advance!
EDIT
Testing with the following code:
File path = Environment.getExternalStorageDirectory();
String pathS = path.getPath();
When the SDCard is in the slot, the pathS
contains mnt/sdcard
, but when I removes the SDCard the pathS
is still /mnt/sdcard
...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…