Пример #1
0
 private void setPrefs() {
   SharedPreferences prefs =
       PreferenceManager.getDefaultSharedPreferences(GraphiteApp.getContext());
   prefs.registerOnSharedPreferenceChangeListener(this);
   serverUrl = prefs.getString("server_url", "");
   targetFilter = prefs.getString("target_filter", "*");
 }
Пример #2
0
  @Override
  public void dispose() {
    super.dispose();
    workerThread.getLooper().quit();

    SharedPreferences prefs =
        PreferenceManager.getDefaultSharedPreferences(GraphiteApp.getContext());
    prefs.unregisterOnSharedPreferenceChangeListener(this);
  }