diff options
author | Wei Huang <weih@google.com> | 2012-03-15 15:23:00 -0700 |
---|---|---|
committer | Wei Huang <weih@google.com> | 2012-03-15 15:29:28 -0700 |
commit | 6fe7e6ae561511922f99346a8021f44a126c6218 (patch) | |
tree | c759ef35b34b53a51cd0569e612eeb84b4a5b9e1 /src/com/android/gallery3d/app/ActivityState.java | |
parent | be0cb26de2b21fd5166b05ff5db427636344b7b6 (diff) | |
download | android_packages_apps_Snap-6fe7e6ae561511922f99346a8021f44a126c6218.tar.gz android_packages_apps_Snap-6fe7e6ae561511922f99346a8021f44a126c6218.tar.bz2 android_packages_apps_Snap-6fe7e6ae561511922f99346a8021f44a126c6218.zip |
bug #6176711: guard against null GalleryActionBar.
When entering Gallery app from WallPaper picker, the activity is DialogPicker, which doesn't initialize GalleryActionbar so getGalleryActionbar() returns null. Guard against using the null object.
I fixed the obvious NPE here, but Ray or Yuli should take a closer look, to see why this is broken.
Change-Id: Ic6923c388ea7b72ab402131fc3b039546509e340
Diffstat (limited to 'src/com/android/gallery3d/app/ActivityState.java')
-rw-r--r-- | src/com/android/gallery3d/app/ActivityState.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/ActivityState.java b/src/com/android/gallery3d/app/ActivityState.java index 443e2bd29..384ae734b 100644 --- a/src/com/android/gallery3d/app/ActivityState.java +++ b/src/com/android/gallery3d/app/ActivityState.java @@ -141,7 +141,10 @@ abstract public class ActivityState { actionBar.show(); } int stateCount = mActivity.getStateManager().getStateCount(); - mActivity.getGalleryActionBar().setDisplayOptions(stateCount > 1, true); + GalleryActionBar galleryActionbar = mActivity.getGalleryActionBar(); + if (galleryActionbar != null) { + galleryActionbar.setDisplayOptions(stateCount > 1, true); + } // Default behavior, this can be overridden in ActivityState's onResume. actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); } |