'onPreferenceChange' is called twice when saving the new value.