private void setPrefs() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GraphiteApp.getContext()); prefs.registerOnSharedPreferenceChangeListener(this); serverUrl = prefs.getString("server_url", ""); targetFilter = prefs.getString("target_filter", "*"); }
@Override public void dispose() { super.dispose(); workerThread.getLooper().quit(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GraphiteApp.getContext()); prefs.unregisterOnSharedPreferenceChangeListener(this); }