I have a problem with storing string set preference. I have these utility methods for storing:
public static void putStringSet(SharedPreferences pref, Editor
My condition is very similar to yours, the only difference is when restart the app, preference contains A, B, C, but when reinstall it or reboot the phone, B&C are gone.
I also tried replace commit() with apply(), as this post adviced SharedPreferences not persistent , but still not to work.
I solved this problem by remove & commit the preference before replacing it:
editor.remove("StringSetKey");
editor.commit();
editor.putStringSet("StringSetKey", newSet);
editor.commit();
Ps: you can type adb pull /data/data/ in cmd line to see if the commit() really works
Pps: I think this is a bug with putStringSet....
hope this will help you ;)