summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/PhotoModule.java12
-rw-r--r--src/com/android/camera/VideoModule.java12
2 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 03235cc90..f709174e2 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1866,6 +1866,14 @@ public class PhotoModule
Log.e(TAG,"loadCameraPreferences() updating camera_id pref");
+ IconListPreference switchIconPref =
+ (IconListPreference)mPreferenceGroup.findPreference(
+ CameraSettings.KEY_CAMERA_ID);
+
+ //if numOfCams < 2 then switchIconPref will be null as there is no switch icon in this case
+ if (switchIconPref == null)
+ return;
+
int[] iconIds = new int[numOfCams];
String[] entries = new String[numOfCams];
String[] labels = new String[numOfCams];
@@ -1886,10 +1894,6 @@ public class PhotoModule
}
}
- IconListPreference switchIconPref =
- (IconListPreference)mPreferenceGroup.findPreference(
- CameraSettings.KEY_CAMERA_ID);
-
switchIconPref.setIconIds(iconIds);
switchIconPref.setEntries(entries);
switchIconPref.setLabels(labels);
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 8cb372f5e..04aa1fb8f 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -534,6 +534,14 @@ public class VideoModule implements CameraModule,
Log.e(TAG,"loadCameraPreferences() updating camera_id pref");
+ IconListPreference switchIconPref =
+ (IconListPreference)mPreferenceGroup.findPreference(
+ CameraSettings.KEY_CAMERA_ID);
+
+ //if numOfCams < 2 then switchIconPref will be null as there is no switch icon in this case
+ if (switchIconPref == null)
+ return;
+
int[] iconIds = new int[numOfCams];
String[] entries = new String[numOfCams];
String[] labels = new String[numOfCams];
@@ -554,10 +562,6 @@ public class VideoModule implements CameraModule,
}
}
- IconListPreference switchIconPref =
- (IconListPreference)mPreferenceGroup.findPreference(
- CameraSettings.KEY_CAMERA_ID);
-
switchIconPref.setIconIds(iconIds);
switchIconPref.setEntries(entries);
switchIconPref.setLabels(labels);