android获取外置sd卡路径
对于获取android的外置sd卡路径纠结了好长时间,可能是我的境界还不够吧,找到了方法却不知道是什么意思,只知道是使用StorageManager,我先把获取方法贴出来,最近好好研究一下StorageManager这个类,研究完了再来补充,下面是方法: public String [] getStoragePath() { try { StorageManager sm = (StorageManager) getSystemService(STORAGE_SERVICE); Method getVolumePathsMethod = StorageManager.class.getMethod( "getVolumePaths" , (Class<?>[]) null ); String [] paths = ( String []) getVolumePathsMethod.invoke(sm, ( Object []) null ); return paths; } catch (Exception e) { Log.e( "info" , "getStoragePath() failed" , e); } return null ; } 这个方法获取的是所有可用存储的路径,其中path[0]是内置存储路径,path[1]是外置存储路径。 补充