kotlin shared preference editor code example
Example: refresh sharedpreferences going back java
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);