Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial / reference to launch ACTION_EDIT with image and return image

I'm writing an app that uses the camera. I want to lauch an intent to allow users to annotate the resulting image with lines and text, AND I would like to provide the user with a list of appropriate image editting apps they can use, but I'm coming across these problems: 1. Not all image editting apps appear in the list when I perform this code:

editIntent = new Intent();
editIntent.setAction(Intent.ACTION_EDIT);
Uri imageToEditUri = selectedPhotoLocation;  // Uri of existing photo
String imageToEditMimeType = "image/*";
editIntent.setDataAndType(imageToEditUri, imageToEditMimeType);
startActivityForResult(Intent.createChooser(editIntent,"Edit Image"), IMPLICIT_EDIT_IMAGE);

Is there a way to get a list of apps that will respond to Intent.ACTION_EDIT?

2. PS Express is the only app I've found that returns the Uri of the editted image in the data.getDate() Uri returned to OnActivityResult(), with other apps the user is forced to save, remember the location, and reselect the editted image.

Is there a way to know what apps return the Uri of the image to OnActivityResult()
like image 523
user1546124 Avatar asked Jul 23 '12 14:07

user1546124


2 Answers

Not all image editting apps appear in the list when I perform this code

Just because an app implements image editing does not necessarily mean that it is set up to allow third parties to link to their image-editing activities.

Is there a way to get a list of apps that will respond to Intent.ACTION_EDIT?

If you mean that you want to do this programmatically at runtime, see Jedil's answer.

Is there a way to know what apps return the Uri of the image to OnActivityResult()

No, except for those applications that have documentation on how developers should integrate with them.

like image 57
CommonsWare Avatar answered Nov 15 '22 08:11

CommonsWare


First question answer:
try queryIntentActivities

Intent editIntent = new Intent(android.content.Intent.ACTION_EDIT);
List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(editIntent, 0);
like image 20
michal.luszczuk Avatar answered Nov 15 '22 08:11

michal.luszczuk