我想檢查是否有外部存儲器或設備不使用這樣的下面如何獲得在android6.0編程
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/";
}
但在棉花糖給定的外部存儲路徑SD_Card路徑I續找到這在使用ES FILEMANAGER進行檢查時,他們給Moto G第三代存儲/ 3263-3131。雖然檢查其他棉花糖設備,數量變得不同。請幫我檢查棉花糖設備是否有外部存儲?如果找到存儲意味着如何獲得外部存儲的路徑?
注意: - 我在我的應用程序中授予了存儲權限,並且在我的應用程序的設置中啓用了存儲權限。
在此先感謝您,並且您是否發現我的問題中有任何錯誤,請立即通知。再次感謝你。
請告訴我爲什麼要爲這個問題投票嗎?如果有人知道答案這意味着請讓我知道... – Palanivelraghul