summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-10-30 12:14:39 (GMT)
committerDanny Baumann <dannybaumann@web.de>2016-10-30 12:14:39 (GMT)
commit85e8e6d1ccc5435fac4b224ffecc623ce6b7c833 (patch)
treea5563d9609d55fafefdea93c871deddf0763ba81
parent2282e80cd40ccd7255d82470f39043d0de1c46d1 (diff)
downloadandroid_packages_apps_Snap-85e8e6d1ccc5435fac4b224ffecc623ce6b7c833.zip
android_packages_apps_Snap-85e8e6d1ccc5435fac4b224ffecc623ce6b7c833.tar.gz
android_packages_apps_Snap-85e8e6d1ccc5435fac4b224ffecc623ce6b7c833.tar.bz2
Fix off-by-one error in submenu selection handling.
Change-Id: I7e0f44110735d8e098abdf9724e89a837b96c3e9
-rw-r--r--src/com/android/camera/ui/ListSubMenu.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ListSubMenu.java b/src/com/android/camera/ui/ListSubMenu.java
index 87c99c0..1965cec 100644
--- a/src/com/android/camera/ui/ListSubMenu.java
+++ b/src/com/android/camera/ui/ListSubMenu.java
@@ -138,6 +138,10 @@ public class ListSubMenu extends ListView implements
@Override
public void onItemClick(AdapterView<?> parent, View view,
int index, long id) {
+ index -= getHeaderViewsCount();
+ if (index < 0 || index >= getAdapter().getCount()) {
+ return;
+ }
mPreference.setValueIndex(index);
if (mListener != null)
mListener.onListPrefChanged(mPreference);