Exemplo n.º 1
0
 @Override
 public boolean onPreferenceChange(Preference preference, Object newValue) {
   String id = preference.getKey();
   super.onPreferenceChange(preference, newValue);
   if (id.equals(settings.ROUTER_SERVICE.getId())) {
     routerServicePreference.setSummary(
         getString(R.string.router_service_descr) + "  [" + settings.ROUTER_SERVICE.get() + "]");
     prepareRoutingPrefs(getPreferenceScreen());
     super.updateAllSettings();
   } else if (id.equals(settings.WAKE_ON_VOICE_INT.getId())) {
     Integer value;
     try {
       value = Integer.parseInt(newValue.toString());
     } catch (NumberFormatException e) {
       value = 0;
     }
     if (value > 0) {
       requestLockScreenAdmin();
     }
   }
   return true;
 }
Exemplo n.º 2
0
 public void updateAllSettings() {
   prepareRoutingPrefs(getPreferenceScreen());
   super.updateAllSettings();
   routerServicePreference.setSummary(
       getString(R.string.router_service_descr) + "  [" + settings.ROUTER_SERVICE.get() + "]");
 }