本文介绍了即使我卸载它的Andr​​oid有时我二次storage.exists()返回true的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图检测第二外部存储(的 SD卡的)卸除使用广播接收器,如果是这样开始运行一个线程并直到SD卡被安装完成它。它工作正常,偶尔为之。然而,当我试图知道如果目录存在与否,它有时返回true,即使SD卡卸载!它为什么会发生?是因为缓存内存或其他什么东西呢?我真的不知道我应该怎么解决这个问题。

I tried to detect secondary external storage(SD card) unmounted using broadcast receiver, and if so start running a thread and finish it until SD card is mounted. It works fine occasionally. however, when I try to know if directory exists or not, it sometimes returns true even if SD card is unmounted! Why does it happen? Is it because of the cache memory or something else? I really have no idea how I should solve this problem.

推荐答案

这可能是因为它通过模拟内部存储的SD卡。你能卸载SD卡后,确认外部存储的内容是什么? (也是你身体取出SD卡?)

It's possible that it's emulating the SD Card via the internal storage. Can you verify the contents of the external storage after unmounting SD card? (Also are you physically removing the SD card?)

这篇关于即使我卸载它的Andr​​oid有时我二次storage.exists()返回true的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 11:07