diff --git a/android_app/app/src/main/java/com/health/openscale/gui/preferences/MeasurementPreferences.java b/android_app/app/src/main/java/com/health/openscale/gui/preferences/MeasurementPreferences.java index 6b815249..1fe5b0c7 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/preferences/MeasurementPreferences.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/preferences/MeasurementPreferences.java @@ -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); } }