File sdDir = Environment.getExternalStorageDirectory();//获取SDCard根目录
// 存储管理器
StorageManager sm = (StorageManager) getSystemService(Context.STORAGE_SERVICE);
// 获取sdcard的路径:外置和内置
try {
String[] paths = (String[]) sm.getClass()
.getMethod("getVolumePaths", null).invoke(sm, null);
for (String string : paths) {
System.out.println("path=" + string);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
03-15 10:48:54.707: I/System.out(5840): path=/mnt/sdcard
03-15 10:48:54.707: I/System.out(5840): path=/mnt/external_sd
03-15 10:48:54.707: I/System.out(5840): path=/mnt/usb_storage