StorageManager sm = (StorageManager) getSystemService(STORAGE_SERVICE);
// 获取sdcard的路径:外置和内置
try {
String[] paths = (String[]) sm.getClass().getMethod("getVolumePaths", null).invoke(sm, null);
} catch (Exception e) {
e.printStackTrace();
}
// 获取sdcard的路径:外置和内置
try {
String[] paths = (String[]) sm.getClass().getMethod("getVolumePaths", null).invoke(sm, null);
} catch (Exception e) {
e.printStackTrace();
}