Environment.isExternalStorageRemovable()
在API 9中添加
并Environment.isExternalStorageEmulated()
在API 11中添加
isExternalStorageRemovable
当getExternalStorageDirectory
路径可移动或不移动时返回true ,更像是SD卡,如果返回false,则其内部存储永远不会被物理移除.
而且isExternalStorageEmulated
恰恰相反isExternalStorageRemovable
?
现在,我的问题是什么区别?它只是具有相反输出的不同名称吗?
isExternalStorageEmulated() == true
意味着没有真正的SD卡,它只是模拟(例如Nexus 5).如果外部存储没有被模拟,isExternalStorageEmulated() == false
那么它可以是可移动的,也可以不是,这就是我们拥有的原因isExternalStorageRemovable()