admin管理员组

文章数量:1639597


public static String getUsbExtention(){
    String sdfiles="";
    StorageManager storageManager = (StorageManager) AppApplication.sharedApplication().getSystemService(Context.STORAGE_SERVICE);
    try {
        Class<?>[] paramClasses = {};
        Method getVolumePathsMethod = StorageManager.class.getMethod("getVolumePaths", paramClasses);
        getVolumePathsMethod.setAccessible(true);
        Object[] params = {};
        Object invoke = getVolumePathsMethod.invoke(storageManager, params);
        for (int i = 0; i < ((String[])invoke).length; i++) {
		
            Log.i("TAG", "path----> " + ((String[])invoke)[i].toString());
        }
    } catch (NoSuchMethodException e1) {
        e1.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    }
    return sdfiles;
}

本文标签: android