Android shared preference Issue
<p>HI All,</p>

<p>In my activity i have used default shared prefrence to store some data..and it is stored also.
But when i want to access the shared prefrence outside the class(Simple class without activity) my project is showing errors.</p>

<p>Code:</p>

<pre><code> SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this);
     user = p.getString("Username", null);
         pass=p.getString("Password", null);
</code></pre>

<p>its showing redline on getDefaultSharedPreferences and when i mouse over it then it is showing</p>

<p>The method getDefaultSharedPreferences(Context) in the type PreferenceManager is not applicable for the arguments (Myclassname)</p>

<p>Can anybody pls help me...i want to access my shared prefrence outside the activity class which is not an activity.</p>

<p>Thanks in advance.</p>
