【发布时间】:2016-04-21 09:54:32
【问题描述】:
我正在尝试使用下面给出的外部存储路径来检查设备是否具有外部存储
if (new File("/ext_card/").exists()) {
specialPath = "/ext_card/";
} else if (new File("/mnt/sdcard/external_sd/").exists()) {
specialPath = "/mnt/sdcard/external_sd/";
} else if (new File("/storage/extSdCard/").exists()) {
specialPath = "/storage/extSdCard/";
} else if (new File("/mnt/extSdCard/").exists()) {
specialPath = "/mnt/extSdCard/";
} else if (new File("/mnt/sdcard/external_sd/").exists()) {
specialPath = "/mnt/sdcard/external_sd/";
} else if (new File("storage/sdcard1/").exists()) {
specialPath = "storage/sdcard1/";
}
但在棉花糖中,我找不到这条路径,并且在使用 ES FILEMANAGER 检查时,它们在 Moto G 第三代中给出了类似 storage/3263-3131 的信息。在检查其他棉花糖设备时,数字会有所不同。请帮我检查棉花糖设备是否有外部存储?如果找到存储意味着如何获取该外部存储的路径?
注意:- 我在我的应用程序中授予了存储权限,并在我的应用程序的设置中启用了存储权限。
在此先感谢您是否在我的问题中发现任何错误,请 crt 。再次感谢。
【问题讨论】:
-
请告诉我为什么对这个问题投反对票?如果有人知道这个方法的答案,请告诉我...
标签: android android-6.0-marshmallow