From 8085e1fcda882074ed387d3e999c448a84d6eb3b Mon Sep 17 00:00:00 2001 From: Andrew Sapperstein Date: Fri, 27 Jul 2012 11:24:04 -0700 Subject: Partial fix of 6890014. No longer crashing. But the attachment is now in a very weird state. Change-Id: If688d9c19a81124cbd1ecd0266821800f76f3c74 --- photoviewer/src/com/android/ex/photo/Intents.java | 5 ----- photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java | 2 +- photoviewer/src/com/android/ex/photo/util/ImageUtils.java | 2 ++ 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'photoviewer') diff --git a/photoviewer/src/com/android/ex/photo/Intents.java b/photoviewer/src/com/android/ex/photo/Intents.java index 7e31169..be90b69 100644 --- a/photoviewer/src/com/android/ex/photo/Intents.java +++ b/photoviewer/src/com/android/ex/photo/Intents.java @@ -128,11 +128,6 @@ public class Intents { /** Build the intent */ public Intent build() { - if (TextUtils.isEmpty(mPhotosUri) && TextUtils.isEmpty(mResolvedPhotoUri)) { - throw new IllegalArgumentException( - "Either PhotosUri or ResolvedPhotoUri must be set."); - } - mIntent.setAction(Intent.ACTION_VIEW); mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); diff --git a/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java b/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java index 0c7ba63..28756c1 100644 --- a/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java +++ b/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java @@ -48,7 +48,7 @@ public class PhotoPagerAdapter extends BaseCursorPagerAdapter { // create new PhotoViewFragment final PhotoViewIntentBuilder builder = Intents.newPhotoViewFragmentIntentBuilder(mContext); - builder + builder .setPhotoName(photoName) .setResolvedPhotoUri(photoUri) .setThumbnailUri(thumbnailUri); diff --git a/photoviewer/src/com/android/ex/photo/util/ImageUtils.java b/photoviewer/src/com/android/ex/photo/util/ImageUtils.java index 7519d6f..8564457 100644 --- a/photoviewer/src/com/android/ex/photo/util/ImageUtils.java +++ b/photoviewer/src/com/android/ex/photo/util/ImageUtils.java @@ -105,6 +105,8 @@ public class ImageUtils { // Do nothing - the photo will appear to be missing } catch (IOException exception) { // Do nothing - the photo will appear to be missing + } catch (IllegalArgumentException exception) { + // Do nothing - the photo will appear to be missing } finally { try { if (inputStream != null) { -- cgit v1.2.3