Android: File.exists returns true when it should return false
I have a bizarre problem. I write a file to the SD card and then I remove the SD card. With the card removed, I then check for the existence of the file with File.exists.
The path to the file clearly indicates /mnt/sdcard/MyAppFolder/.....
So with:
File f = new File(filename);
Boolean exists = f.exists();
it returns true. How is this possible. The SD card is not even inserted. I stopped and re-ran the app but it always returns true. Wow Android is super!! It even keeps a connection to your SD card no matter where it is. Seriously folks, wh开发者_如何学运维at am I doing wrong?
精彩评论