开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜