Actually use CheckboxPreference defaults in preferences.xml!

git-svn-id: https://zxing.googlecode.com/svn/trunk@2101 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-01-01 21:49:17 +00:00
parent f13443cac8
commit 0b58fc05d6
2 changed files with 5 additions and 3 deletions

View file

@ -159,6 +159,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
inactivityTimer = new InactivityTimer(this);
beepManager = new BeepManager(this);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
showHelpOnFirstLaunch();
}

View file

@ -59,13 +59,13 @@ final class DecodeThread extends Thread {
if (decodeFormats == null || decodeFormats.isEmpty()) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
decodeFormats = EnumSet.noneOf(BarcodeFormat.class);
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D, true)) {
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D, false)) {
decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
}
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, true)) {
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, false)) {
decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
}
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, true)) {
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, false)) {
decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
}
}