예제 #1
0
 @Override
 public void onDestroy() {
   SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
   prefs.unregisterOnSharedPreferenceChangeListener(this);
   super.onDestroy();
   SettingsManager.save();
 }
예제 #2
0
    @Override
    public void onDestroy() {
      PreferenceGroup prefGroup = getPreferenceScreen();
      for (int i = 0; i < prefGroup.getPreferenceCount(); i++) {
        Preference pref = prefGroup.getPreference(i);
        if (pref instanceof CheckBoxPreference) {
          CheckBoxPreference checkBoxPref = (CheckBoxPreference) pref;
          SettingsManager.setPreferenceBoolean(checkBoxPref.getKey(), checkBoxPref.isChecked());
        }
      }

      super.onDestroy();
    }
예제 #3
0
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      addPreferencesFromResource(R.xml.settings_emu_fragment);

      PreferenceGroup prefGroup = getPreferenceScreen();
      for (int i = 0; i < prefGroup.getPreferenceCount(); i++) {
        Preference pref = prefGroup.getPreference(i);
        if (pref instanceof CheckBoxPreference) {
          CheckBoxPreference checkBoxPref = (CheckBoxPreference) pref;
          checkBoxPref.setChecked(SettingsManager.getPreferenceBoolean(checkBoxPref.getKey()));
        }
      }
    }