Instead of
finish();
startActivity(getIntent());
I prefer the following code :
setPreferenceScreen(null);
addPreferencesFromResource(R.xml.preferences);
This will reset the display as well but without the whole finish procedure and its consequences.
Plus this code works well with PreferenceActivity
and PreferenceFragment
.
This is interesting if you would like to change dynamically the locale value for example. In this case, working with the manager is not enough because you want a full reload of titles and values.
EDIT: setPreferenceScreen
is deprecated in PreferenceActivity
(still working) but is not in PreferenceFragment