diff options
-rwxr-xr-x | src/com/android/camera/CameraActivity.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index a3a666f25..ec794f2cb 100755 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -608,14 +608,22 @@ public class CameraActivity extends Activity intent.putExtra(KEY_TOTAL_NUMBER, (adapter.getTotalNumber() -1)); startActivity(intent); } catch (ActivityNotFoundException ex) { - try { - Log.w(TAG, "Gallery not found"); - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - intent.putExtra(KEY_FROM_SNAPCAM, true); - startActivity(intent); - } catch (ActivityNotFoundException e) { - Log.w(TAG, "No Activity could be found to open image or video"); - } + gotoViewPhoto(uri); + } catch (IllegalArgumentException ex) { + gotoViewPhoto(uri); + } + } + + private void gotoViewPhoto(Uri uri) { + try { + Log.w(TAG, "Gallery not found"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + intent.putExtra(KEY_FROM_SNAPCAM, true); + } catch (ActivityNotFoundException e) { + Log.w(TAG, "No Activity could be found to open image or video"); + } catch (IllegalArgumentException e) { + Log.w(TAG, "No Activity could be found to open image or video"); } } |