diff options
author | Owen Lin <owenlin@google.com> | 2012-04-20 18:42:22 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2012-04-25 15:27:42 +0800 |
commit | 56363ddedc94981a0745065d792603bbf7d23878 (patch) | |
tree | 4faee2c40a139c709434950af028cb3b1554319c /src/com/android/gallery3d/app/PhotoPage.java | |
parent | c79766a95de4635145a0426ed822af6c4732a70c (diff) | |
download | android_packages_apps_Snap-56363ddedc94981a0745065d792603bbf7d23878.tar.gz android_packages_apps_Snap-56363ddedc94981a0745065d792603bbf7d23878.tar.bz2 android_packages_apps_Snap-56363ddedc94981a0745065d792603bbf7d23878.zip |
Fix NPE in Gallery.
This happens if user set type in an intent. But we get a different type from
content resolver.
Change-Id: Iabafce7f7aaff23a7a9ee09e1d38ab50049abc88
fix: 6358473
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoPage.java')
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 6e5343ba8..bdc406019 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -19,13 +19,10 @@ package com.android.gallery3d.app; import android.app.ActionBar.OnMenuVisibilityListener; import android.app.Activity; import android.content.ActivityNotFoundException; -import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.graphics.Rect; import android.net.Uri; -import android.nfc.NdefMessage; -import android.nfc.NdefRecord; import android.nfc.NfcAdapter; import android.os.Bundle; import android.os.Handler; @@ -34,8 +31,6 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.view.View.MeasureSpec; -import android.view.ViewGroup; import android.view.WindowManager; import android.widget.ShareActionProvider; import android.widget.Toast; @@ -57,9 +52,9 @@ import com.android.gallery3d.ui.GLCanvas; import com.android.gallery3d.ui.GLView; import com.android.gallery3d.ui.ImportCompleteListener; import com.android.gallery3d.ui.MenuExecutor; +import com.android.gallery3d.ui.PhotoView; import com.android.gallery3d.ui.ScreenNail; import com.android.gallery3d.ui.ScreenNailHolder; -import com.android.gallery3d.ui.PhotoView; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SynchronizedHandler; import com.android.gallery3d.ui.UserInteractionListener; @@ -578,8 +573,8 @@ public class PhotoPage extends ActivityState case REQUEST_CROP: if (resultCode == Activity.RESULT_OK) { if (data == null) break; - Path path = mApplication - .getDataManager().findPathByUri(data.getData()); + Path path = mApplication.getDataManager() + .findPathByUri(data.getData(), data.getType()); if (path != null) { mModel.setCurrentPhoto(path, mCurrentIndex); } |