This is what a helper looks like.
public class MyPrefs { public static final String PREFS_NAME = "MyPrefsFile"; private final String APPS = "apps"; private static MyPrefs instanse; private SharedPreferences mPref; public static MyPrefs getInstanse() { if (null != instanse) { return instanse; } return new MyPrefs(); } private MyPrefs() { mPref = MyApplication.getContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); } //App's settings public void addApp(String appName){ HashSet<String> apps = getBootApps(); apps.add(appName); addAllBootApps(apps); } public void addAllApps(HashSet<String> apps){ SharedPreferences.Editor editor = mPref.edit(); editor.putStringSet(APPS, apps); editor.apply(); } public HashSet<String> getApps(){ return (HashSet<String>) mPref.getStringSet(APPS,new HashSet<String>()); } public void deleteApp(String appName){ HashSet<String> apps = getApps(); apps.remove(appName); addAllApps(apps); } public void removewAllApps(){ addAllApps(new HashSet<String>()); } } with it, I first write through addApp() and immediately getApps() contents with getApps() and all changes are visible, but after restarting the application there is nothing there, and I use the same methods.