title: Android getDefaultSharedPreferences
body: <p>My code is:</p>
  
  <pre><code>final String eulaKey = "mykey";
  final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  boolean hasBeenShown = prefs.getBoolean(eulaKey, false);
  </code></pre>
  
  <p>Always returns different values depending on os version. Tested in 2.2, 2.3.4, 3.2, 4.0.3 - returns correct value. But for device Zte blade with 2.3.7 with CianogenMod 7.1 - result is always false. I suppose default value for getBoolean.</p>
  
  <p>Here is code writing boolean:</p>
  
  <pre><code>final String eulaKey = "mykey";
  final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  SharedPreferences.Editor editor = prefs.edit();
  editor.putBoolean(eulaKey, true);
  editor.commit();
  </code></pre>
  
  <p>Does anybody have any idea?</p>
  
  <p>Update:
  Comparing my current code with my previous version of code - there is no difference in code.
  Only difference is in manifest: code works Ok  with minVersion=8 and targetVersion=8
  Now I'm compiling with minversion=8 and target=13 /because of Admob/.
  Maybe some APIs changed, but I found nothing on this.</p>
  
  <p>SOLUTION:
  -Starting app from shortcut and from menu gives me different DefaultSharedPreferences. After removing DefaultSharedPreferences from my code - it works perfect. I can't just say: people don't make shortcuts, so I had to change code.</p>