Java 谷歌+;4.3及以上版本无法访问“/storage/simulated/legacy/”,以从中裁剪图像

Java 谷歌+;4.3及以上版本无法访问“/storage/simulated/legacy/”,以从中裁剪图像,java,android,image,storage,google-plus,Java,Android,Image,Storage,Google Plus,在我的android应用程序中,我要求“谷歌+照片应用程序”在路径下裁剪图像 `file:///storage/emulated/0/myApp/ProfileImageCapture.tmp`` 然后我要求它将裁剪后的图像保存到/storage/emulated/0/myApp/ProfileImage.tmp 我用的是Nexus5,安卓4.4.2 这是我的密码 // Crop and resize the image for profile private void cropImag

在我的android应用程序中,我要求“谷歌+照片应用程序”在路径下裁剪图像

`file:///storage/emulated/0/myApp/ProfileImageCapture.tmp``

然后我要求它将裁剪后的图像保存到
/storage/emulated/0/myApp/ProfileImage.tmp
我用的是Nexus5,安卓4.4.2

这是我的密码

  // Crop and resize the image for profile
  private void cropImage(Uri imageCaptureUri) {
    // Use existing crop activity.
    Intent intent = new Intent("com.android.camera.action.CROP");
    intent.setDataAndType(imageCaptureUri, AccountSignInDetails.IMAGE_UNSPECIFIED);

    // Specify the output path
    File imageFile =
        new File(ResManager.mAppDir, AccountSignInDetails.PROFILE_IMAGE_FILE);
    intent.putExtra("output", Uri.fromFile(imageFile));

    // Specify image size
    intent.putExtra("outputX", 100);
    intent.putExtra("outputY", 100);

    // Specify aspect ratio, 1:1
    intent.putExtra("aspectX", 1);
    intent.putExtra("aspectY", 1);
    intent.putExtra("scale", true);
    intent.putExtra("return-data", true);
    mActivity.startActivityForResult(intent, ImageTaker.REQUEST_CODE_CROP_PHOTO);
  }
在哪里

imageCaptureUri=file:///storage/emulated/0/myApp/ProfileImageCapture.tmp

imageFile=/storage/emulated/0/myApp/ProfileImage.tmp

任何其他裁剪器都可以访问此路径

但是“Google plus cropper”显示了其他图像(我猜这是它能访问的最后一张图像)

这只发生在谷歌+4.3及以上版本上

返回到4.2,裁剪者设法访问照片

无指示性logcat错误


如何修复此问题?

这可能会帮助您查看我的更新:它仅在Google+4.3及以上版本上发生