title: SharedPreferences will not save/load in PreferenceActivity
body: <p><strong>EDIT:</strong> <em>The problem described below was due to a very peculiar device issue not caused by any coding-related problem.</em></p>
  
  <p>I have a preferenceActivity in which I have many checkBoxPreferences.
  The checkBoxPreference is suppose to save the the default shared preferences file, and then be called again when I open the app in order to update the UI.</p>
  
  <p>This does not happen like it's suppose to. 
  If I close the app and open it back up, my values remain like they are suppose to, but if I use task manager to end the app or if I power cycle the phone (when the app is not running) then the defaultValues are called again.</p>
  
  <p>So, I created a SharedPreference in my onResume() to test it.</p>
  
  <pre><code>SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  </code></pre>
  
  <p>I then check to see if there is a key in that sharedpreference.</p>
  
  <pre><code>pref.contains("myCheckBoxPreference");
  </code></pre>
  
  <p>When I close out and open it back up, it returns true. if I close with the task manager or power cycle the phone off and on, then that returns false.</p>
  
  <p>So, I tried manually setting the SharedPreference</p>
  
  <pre><code>SharedPreferences.Editor editor = pref.edit();
  editor.putBoolean("myCheckBoxPreference", myCheckBoxPreference.isChecked());
  editor.commit();
  </code></pre>
  
  <p>and then I called that when the checkboxpreference value changed. I also tried calling it in onStop and onPause. Still, if I close the app and open it back up, pref.contains returns true, but if I power cycle the phone off and back on, it returns false.</p>
  
  <p>So I then tried using a SharedPreferences file.</p>
  
  <p>In the class declaration:</p>
  
  <pre><code>public static final String PREFS = "prefs";
  </code></pre>
  
  <p>And in the onResume():</p>
  
  <pre><code>SharedPreferences pref = this.getSharedPreferences(PREFS, 0);
  </code></pre>
  
  <p>Same behavior, pref.contains still returns true if I just close the app and open it back up, but it returns false if I power the phone off and back on.</p>
  
  <p>I then tried changing the key value of myCheckBoxPreference to something that did NOT match the xml key for the CheckBoxPreference, and it still had the same effect.</p>
  
  <p>And I uninstalled the application from the phone, then powered the phone off and back on, and then re-installed, and it still has the same effect.</p>