title: StrictModeDiskReadViolation when
body: <p>I am trying to use SharedPreferences to store some user settings for my app. I have this code in my Activity.onCreate method:</p>
  
  <pre><code>sharedPreferences = context.getSharedPreferences("MMPreferences", 0);
  soundOn = sharedPreferences.getBoolean("soundOn", true);
  </code></pre>
  
  <p>but it gives me this error (it is the getBoolean that generates the error):</p>
  
  <pre><code>11-10 16:32:24.652: D/StrictMode(706): StrictMode policy violation; ~duration=229 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=2079 violation=2
  </code></pre>
  
  <p>and the result is that the value is not read and I also get the same error when I try to write to the SharedPreferences with this code (it is the commit that generates the error):</p>
  
  <pre><code>SharedPreferences.Editor editor = sharedPreferences.edit();
  editor.putBoolean("soundOn", soundOn);
  editor.commit();
  </code></pre>
  
  <p>The only answers for this error I can find is about a strict mode warning, but my code actually fails to read/write the SharedPreferences key/value data.</p>