mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-29 19:20:36 +02:00
Merge pull request #200 from erijo/unregister
Add missing listener unregister
This commit is contained in:
@@ -213,12 +213,18 @@ public class MeasurementPreferences extends PreferenceFragment implements Shared
|
||||
getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
updatePrefSummary(findPreference(key));
|
||||
if (!key.equals(MeasurementView.PREF_MEASUREMENT_ORDER)) {
|
||||
measurementOrderCategory.removeAll();
|
||||
updateMeasurementOrderScreen(getContext(), measurementOrderCategory);
|
||||
updateMeasurementOrderScreen(getActivity().getApplicationContext(), measurementOrderCategory);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user