Android: change image intent

I found many questions on how to crop an image. But is there a way to start an image editing operation using intent. I tried with com.android.camera.action.EDIT, but it does not work. I want to do this when I click the button, I start work on editing the image, for example, in the picture below:

enter image description here

I like it when I open the image from the gallery and click Editon the menu.

+5
source share
3 answers

Found a library that can be used for this and works great. Here can be found here .

0
source
Intent editIntent = new Intent(Intent.ACTION_EDIT);
editIntent.setDataAndType(uri, "image/*");
editIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(editIntent, null));
+14
source
        Intent intent = new Intent("com.android.camera.action.CROP");
        intent.setDataAndType(yourimageuri, "image/*");
        intent.putExtra("crop", "true");
        intent.putExtra("aspectX", 1);
        intent.putExtra("aspectY", 1);
        intent.putExtra("outputX", 640);
        intent.putExtra("outputY", 640);
        intent.putExtra("scale", true);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, outPath);
        intent.putExtra("return-data", false);
        intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
        intent.putExtra("noFaceDetection", true);
        startActivityForResult(intent, CAMERA_CROP_RESULT);
+1

All Articles