title: Android: Cannot access other app's SharedPreference
body: <p>I've been searching for days to solve this, but with no success.</p>
  
  <p>I want to get the shared preference settings from my old app and put it on to my new app.
  but I've encounter some security issue (suspect).</p>
  
  <p>my code:</p>
  
  <pre><code>Context c = createPackageContext("my.app.pkg", Context.CONTEXT_IGNORE_SECURITY);            
  SharedPreferences sp = c.getSharedPreferences("my.app.pkg", Context.CONTEXT_IGNORE_SECURITY);
  </code></pre>
  
  <p>Running the code above giving me this:</p>
  
  <blockquote>
    <p>Attempt to read preferences file /data/data/my.app.pkg/shared_prefs/my.app.pkg_preferences.xml without permission</p>
  </blockquote>
  
  <p>even thought the object sp is not null, but it does not retrieve anything from my old app.</p>
  
  <p>I tried googling around and seems like most people can run the code above with no errors.
  Is there anything I've missed out?</p>