I have a Preferences Screen which has some prefs that are interconnected. Which means, if I have pref x
and y
, I sometimes need y
to change to something when x
changes.
What I'm doing at the moment is listening to prefs change event, and do this:
SharedPreferences.Editor editor = prefs.edit();
editor.putString("y_pref", "somevalue");
editor.commit();
The problem is, that to actually see the change I have to first close the prefs screen and then open it again, only that way will I see the newly set prefs.
Is there a way to change the prefs so that the change is visible right away, without the need to reload the prefs screen?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…