@@ -0,0 +1,2005 @@
+package com.maxiee.heartbeat.common;%0A%0Aimport android.annotation.SuppressLint;%0Aimport android.content.Context;%0Aimport android.database.Cursor;%0Aimport android.net.Uri;%0Aimport android.os.Build;%0Aimport android.provider.DocumentsContract;%0Aimport android.provider.MediaStore;%0Aimport android.util.Log;%0A%0A/**%0A * Created by maxiee on 15-9-5.%0A */%0Apublic class FileUtils %7B%0A    @SuppressLint(%22NewApi%22)%0A    public static String uriToPath(Context context, Uri uri) %7B%0A        boolean isKitKat = Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.KITKAT;%0A        if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) %7B%0A            final String docId = DocumentsContract.getDocumentId(uri);%0A            Log.d(%22maxiee%22, %22docID:%22 + docId);%0A            final String%5B%5D split = docId.split(%22:%22);%0A            final String type = split%5B0%5D;%0A            Uri contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;%0A            final String selection = %22_id=?%22;%0A            final String%5B%5D selectionArgs = new String%5B%5D %7Bsplit%5B1%5D%7D;%0A            return getDataColumn(context, contentUri, selection, selectionArgs);%0A        %7D else if (%22content%22.equalsIgnoreCase(uri.getScheme()))%7B%0A            return getDataColumn(context, uri, null, null);%0A        %7D else if (%22file%22.equalsIgnoreCase(uri.getScheme())) %7B%0A            return uri.getPath();%0A        %7D%0A        return null;%0A    %7D%0A%0A    public static String getDataColumn(Context context, Uri uri, String selection, String%5B%5D selectionArgs) %7B%0A        Cursor cursor = null;%0A        final String column = %22_data%22;%0A        final String%5B%5D projection = %7Bcolumn%7D;%0A        try %7B%0A            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);%0A            if (cursor != null && cursor.moveToFirst()) %7B%0A                final int column_index = cursor.getColumnIndexOrThrow(column);%0A                return cursor.getString(column_index);%0A            %7D%0A        %7D finally %7B%0A            if (cursor != null) cursor.close();%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

add a function uriToPath.