title: Android SharedPref not saving on restart
body: <p>In my Android app I can display a popup when the app is updated (Based on <code>versionCode</code>). In the popup I have put a checkbox saying "dont show me again". When I click on that, it will save in the <code>sharedpref</code> the <code>versionCode</code> and wont display the popup anymore.</p>
  
  <p>I have run against something odd behaviours where when I have saving the new <code>Set&lt;String&gt;</code>, it did indeed was saving it but when my app restarts the settings is lost.</p>
  
  <pre><code>Set&lt;String&gt; readAnnouncement = getReadAnnouncement(this);
  readAnnouncement.add(String.valueOf(versionCode));   
  PreferenceManager.getDefaultSharedPreferences(this).edit().putStringSet(KEY_READ_ANN, readAnnouncement).apply();
  </code></pre>
  
  <p>If I break point on <code>readAnnouncement.add</code>, I can set for example the list having 2 items. When I execute the <code>PreferenceManager.getDefaultSharedPrefer...</code> and then execute <code>getReadAnnouncement(this);</code> the value is there, all good.</p>
  
  <p>If I restart the app and check again <code>getReadAnnouncement(this);</code> the new value is gone.</p>
  
  <p>By clearing the cache the problem disappeared... Why was is not saving? Is it possible the <code>SharedPreference</code> were full?</p>