title: Set<String> in android sharedpreferences does not save on force close
body: <p>Im trying to use androids sharedpreferences, I´ve logged everything and the code below really commits the string set. The problem is when I force close the app and start again, the settings.getStringSet returns an empty set. No errormessages anywhere.</p>
  
  <p>I´ve tried PreferenceManager.getDefaultSharedPreferences but that does not work for me either.</p>
  
  <p>Thanks for you time.</p>
  
  <pre><code>public static final String PREFS_NAME = "MyPrefsFile";
  private static final String FOLLOWED_ROUTES = "followedRoutes";
  </code></pre>
  
  <p>and later on when saved is called:</p>
  
  <pre><code>public void onFollowClicked(View view){
  
  SharedPreferences settings = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
  SharedPreferences.Editor editor = settings.edit();
  
  Set&lt;String&gt; follows =  settings.getStringSet(FOLLOWED_ROUTES, new HashSet&lt;String&gt;());
  follows.add(routeId);
  
  editor.putStringSet(FOLLOWED_ROUTES, follows);
  editor.commit();
  
  }
  </code></pre>