Exemplo n.º 1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ContextManager.setContext(this);
    addPreferencesFromResource(getPreferenceResource());
  }
Exemplo n.º 2
0
 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
   super.onWindowFocusChanged(hasFocus);
   if (hasFocus) {
     initializePreference(getPreferenceScreen());
   }
 }
Exemplo n.º 3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    result = savedInstanceState == null ? new Bundle() : savedInstanceState.getBundle(EXTRA_RESULT);

    addPreferencesFromResource(R.xml.preferences_reminders);

    if (preJellybean()) {
      getPreferenceScreen()
          .removePreference(findPreference(getString(R.string.p_rmd_notif_actions_enabled)));
    }

    if (deviceInfo.supportsLocationServices()) {
      setExtraOnChange(R.string.p_geofence_radius, RESET_GEOFENCES);
      setExtraOnChange(R.string.p_geofence_responsiveness, RESET_GEOFENCES);
      setExtraOnChange(R.string.p_geofence_reminders_enabled, TOGGLE_GEOFENCES);
    } else {
      getPreferenceScreen()
          .removePreference(findPreference(getString(R.string.geolocation_reminders)));
    }

    initializeRingtonePreference();
    initializeTimePreference(getDefaultRemindTimePreference(), REQUEST_DEFAULT_REMIND);
    initializeTimePreference(getQuietStartPreference(), REQUEST_QUIET_START);
    initializeTimePreference(getQuietEndPreference(), REQUEST_QUIET_END);
  }
Exemplo n.º 4
0
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (resultCode == RESULT_OK) {
     switch (requestCode) {
       case REQUEST_QUIET_START:
         getQuietStartPreference().handleTimePickerActivityIntent(data);
         return;
       case REQUEST_QUIET_END:
         getQuietEndPreference().handleTimePickerActivityIntent(data);
         return;
       case REQUEST_DEFAULT_REMIND:
         getDefaultRemindTimePreference().handleTimePickerActivityIntent(data);
         return;
     }
   }
   super.onActivityResult(requestCode, resultCode, data);
 }
Exemplo n.º 5
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putBundle(EXTRA_RESULT, result);
 }