diff options
author | Doris Liu <tianliu@google.com> | 2013-03-06 11:22:48 -0800 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2013-03-06 11:23:29 -0800 |
commit | 8892e5e7ffa1f33b527b7753b07723dfd685a9cd (patch) | |
tree | e47540b58771f46da2d74ee54e8b95e5ed4df699 | |
parent | f831c736a3c0c20b59873d98f8abe5b2a234f402 (diff) | |
download | android_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.tar.gz android_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.tar.bz2 android_packages_apps_Gallery2-8892e5e7ffa1f33b527b7753b07723dfd685a9cd.zip |
Fix NPE in switcher popup
Bug: 8327966
Change-Id: I4181a59871c065435756c100b3e8b43930781ee5
-rw-r--r-- | src/com/android/camera/ui/CameraSwitcher.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/CameraSwitcher.java b/src/com/android/camera/ui/CameraSwitcher.java index 897729b46..326416a97 100644 --- a/src/com/android/camera/ui/CameraSwitcher.java +++ b/src/com/android/camera/ui/CameraSwitcher.java @@ -140,7 +140,7 @@ public class CameraSwitcher extends RotateImageView item.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - onCameraSelected(index); + if (showsPopup()) onCameraSelected(index); } }); switch (mDrawIds[i]) { @@ -271,7 +271,7 @@ public class CameraSwitcher extends RotateImageView @Override public void onAnimationEnd(Animator animation) { // Verify that we weren't canceled - if (!showsPopup()) { + if (!showsPopup() && mPopup != null) { mPopup.setVisibility(View.INVISIBLE); ((ViewGroup) mParent).removeView(mPopup); mPopup = null; |