@Override
 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
   if (key.equals(MyApplication.PrefKey.UI_THEME_KEY.getKey())
       || key.equals(MyApplication.PrefKey.UI_LANGUAGE.getKey())
       || key.equals(MyApplication.PrefKey.UI_FONTSIZE.getKey())) {
     scheduledRestart = true;
   }
 }
Esempio n. 2
0
 @Override
 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
   if (key.equals(MyApplication.PrefKey.PERFORM_PROTECTION.getKey())) {
     setProtectionDependentsState();
     AbstractWidget.updateWidgets(this, AccountWidget.class);
     AbstractWidget.updateWidgets(this, TemplateWidget.class);
   } else if (key.equals(MyApplication.PrefKey.UI_FONTSIZE.getKey())
       || key.equals(MyApplication.PrefKey.UI_LANGUAGE.getKey())
       || key.equals(MyApplication.PrefKey.UI_THEME_KEY.getKey())) {
     restart();
   } else if (key.equals(MyApplication.PrefKey.PROTECTION_ENABLE_ACCOUNT_WIDGET.getKey())) {
     Log.d("DEBUG", "shared preference changed: Account Widget");
     AbstractWidget.updateWidgets(this, AccountWidget.class);
   } else if (key.equals(MyApplication.PrefKey.PROTECTION_ENABLE_TEMPLATE_WIDGET.getKey())) {
     Log.d("DEBUG", "shared preference changed: Template Widget");
     AbstractWidget.updateWidgets(this, TemplateWidget.class);
   }
 }