Question

There are more than one app that could handle CROP intent, but I only want gallery to do it without choosing because other app like google+ will have really bad rendering resolution, and choosing process doesn't have good user experience.

Intent intent = new Intent("com.android.camera.action.CROP");
intent.setType("image/*");  
Intent i = new Intent(intent);
ResolveInfo res = list.get(0);
i.setComponent(new ComponentName(res.activityInfo.packageName,
               res.activityInfo.name));
startActivityForResult(intent, REQUEST_CROP_CAMERA);

So how could I specify Gallery app to handle CROP Intent without user's choice?

Was it helpful?

Solution

you could specify the package in your intent:

 intent.setPackage("com.android.gallery");

this will set an explicit application package name

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top