2
運行adb shell,尋找到/ mnt/shell/emulated/0的遺留鏈接但是getCanonicalPath無法獲得/ mnt/shell/emulated/0?爲什麼sdcard legacy getCanonicalPath在Android 4.2操作系統中不能模擬/ 0?
殼@機器人:/存儲/仿真$ LS -l lrwxrwxrwx根根2012年12月7日12:01遺留 - >的/ mnt /殼/模擬/ 0
File file = new File("/storage/emulated/legacy");
String pachString = null;
try {
pachString = file.getCanonicalPath();
// prints /storage/emulated/legacy
} catch (IOException e) {
e.printStackTrace();
}
「READ_EXTERNAL_STORAGE」權限現在需要訪問SD卡 –