Show chooser on EDIT intents that have no activity for action.
Bug: 11571947
Change-Id: I40ef0f9ae6b4567557064d91b9c3942cd524a60b
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index e1d2a92..11e7610 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1394,7 +1394,12 @@
Intent intent = new Intent(Intent.ACTION_EDIT)
.setDataAndType(data.getContentUri(), data.getMimeType())
.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- startActivityForResult(intent, REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ try {
+ startActivityForResult(intent, REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ } catch (ActivityNotFoundException e) {
+ startActivityForResult(Intent.createChooser(intent, null),
+ REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ }
}
/**