I have a PreferenceActivity, but some of the settings can be modified from another Activities also. But when a user modifies a setting from another activity, and then goes to the PreferenceActivity this change is not reflected there.
How can I make the change made from outside be reflected in the PreferenceActivity?
public class SettingsActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.layout.settings);
}
}
and here is the code from another activity
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(Application.getApplication());
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("my_setting", true);
editor.commit();