We investigated the strange behavior.
we have OnSharedPreferenceChangeListener created in main activity and stored on static field:
public static SharedPreferences.OnSharedPreferenceChangeListener listener = null;
Also we created and registered it in onCreate method.
We have three buttons which change the setting and call commit in such way:
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
SharedPreferences.Editor editor = prefs.edit();
editor.putString("setting1", "value");
editor.commit();
The problem is in following:
The onSharedPreferenceChanged didn't raised for the first time when we clicked the button! When we clicked for the second time all is OK. Why the event didn't raised for the first time?