What I'm attempting to do:
Select a photo from my Facebook photos and then send that photo to the native Photo editing experience (the Photos app)
Here are the steps I'm taking:
I'm guessing the problem is that the Photos app doesn't have permission to access the file in my /data/data dir, but I'm curious if anyone can confirm that is indeed the problem and, if so, how you solved it. I'm guessing the solution is to save the file to the SD card instead so that the Photos app can access it?
Ok, here's some code ...
After I've written the Bitmap to file, I call this to get Uri
Uri pictureUri = Uri.fromFile(new File(path))
I then send that Uri to the crop intent like so
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(pictureUri, "image/*");
And start Activity for Result
activity.startActivityForResult(intent, RequestCode.CROP_IMAGE);
Any feedback much appreciated!
You are correct that sharing files often leads to permission problems, particular since READ_EXTERNAL_STORAGE
is a dangerous permission on Android 6.0+ higher devices (requiring you to
Instead, you should follow the sharing files training and use FileProvider to create a Uri that other apps can read without the storage permissions (on your part or on the other app's part).