code: @TargetApi(Build.VERSION_CODES.KITKAT)
  	// (http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content)
      @SuppressLint("NewApi")
  	public static String getPath(final Context context, final Uri uri) {
          final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
  
          // DocumentProvider
          if(isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
              // ExternalStorageProvider
              if(isExternalStorageDocument(uri)) {
                  final String docId = DocumentsContract.getDocumentId(uri);
                  final String[] split = docId.split(":");
                  final String type = split[0];
  
                  if("primary".equalsIgnoreCase(type)) {
                      return Environment.getExternalStorageDirectory() + "/" + split[1];
                  }
              } else if(isDownloadsDocument(uri)) {
                  final String id = DocumentsContract.getDocumentId(uri);
                  if (!TextUtils.isEmpty(id)) {
                      return id.replace("raw:", "");
                  }
                  try {
                      final Uri contentUri = ContentUris.withAppendedId(
                              Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
                      return getDataColumn(context, contentUri, null, null);
                  } catch (NumberFormatException e) {
                      Log.i(TAG,e.getMessage());
                      return null;
                  }
              }
          } else if ("file".equalsIgnoreCase(uri.getScheme()) ||
                  "content".equalsIgnoreCase(uri.getScheme())) {
              return uri.getPath();
          }
  
          return null;
      }
docs: Thanks to Paul Burke on Stack Overflow