Android: Edit image intent

android, android-camera

Solution

Intent editIntent = new Intent(Intent.ACTION_EDIT);
editIntent.setDataAndType(uri, "image/*");
editIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(editIntent, null));

Problem

I found a lot of questions for how to crop an image. But, is there a way to start the edit image activity through an intent. I tried with `com.android.camera.action.EDIT` but it's not working. What I want to do is when I click on a button, start the activity for editing the image, like the one on the picture below: It's like when I open an image from the gallery and click `Edit` from the menu.

Original source