SharedPreferences from different activity
<p>I load from activity A the SharedPreferences in following way:</p>

<pre><code>private void SavePreferences(String key, String value){
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    SharedPreferences.Editor editor = sharedPreferences.edit();
    editor.putString(key, value);
    editor.commit();
   }
</code></pre>

<p>At activity B I want to load the SharedPreferences. Following was a NullPointerException:</p>

<pre><code>   private void LoadPreferences(){   
       SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
       data = sharedPreferences.getString("name", "08:00") ;
   }
</code></pre>

<p>If I try following, I get this compilation error: "No enclosing instance of the type A is accessible in scope"</p>

<pre><code>   private void LoadPreferences(){   
       SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(A.this);
       data = sharedPreferences.getString("name", "08:00") ;
   }
</code></pre>

<p>How can I access the data?
Thanks in advance!</p>
