summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/ListMenu.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/ui/ListMenu.java')
-rw-r--r--src/com/android/camera/ui/ListMenu.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/ListMenu.java b/src/com/android/camera/ui/ListMenu.java
index 53cd48d9c..64bdc342b 100644
--- a/src/com/android/camera/ui/ListMenu.java
+++ b/src/com/android/camera/ui/ListMenu.java
@@ -168,8 +168,12 @@ public class ListMenu extends ListView
// If the preference is overridden, disable the preference
boolean enable = value == null;
mEnabled[j] = enable;
- if (getChildCount() > j) {
- getChildAt(j).setEnabled(enable);
+ int offset = getFirstVisiblePosition();
+ if (offset >= 0) {
+ int indexInView = j - offset;
+ if (getChildCount() > indexInView && indexInView >= 0) {
+ getChildAt(indexInView).setEnabled(enable);
+ }
}
}
}