SharedPreferences 
<p>I'm creating a <code>SharedPreferences</code> and it's working only if I start Activity like this:</p>

<pre><code>myIntent.putExtra("prefName", MYPREFS);
startActivity(myIntent);
</code></pre>

<p>But my SharedPreferences is not working after I save it and hit back a few times, to go at menu page and go to the page where I want to get my preferences.</p>

<p>Anyone can help me with that?</p>

<p>Code below: </p>

<p>This is where I save my preferences:</p>

<pre><code>String MYPREFS = "MyPref";
SharedPreferences mySharedPreferences;
SharedPreferences.Editor myEditor;
</code></pre>

<p>Inside onCreate:</p>

<pre><code>mySharedPreferences = getSharedPreferences(MYPREFS,0);
myEditor = mySharedPreferences.edit();
</code></pre>

<p>Inside button onClickListener:</p>

<pre><code> myEditor.putString("address", AddressET.getText().toString());
    myEditor.putString("contact", ContactET.getText().toString());
    myEditor.commit();

Intent myIntent = new Intent(myContext, nok_individual_particular.class);
myIntent.putExtra("prefName", MYPREFS);
startActivity(myIntent);
</code></pre>

<hr>

<p>This is the activity I pass to:</p>

<pre><code>SharedPreferences mySharedPreferences;
</code></pre>

<p>Inside onCreate:</p>

<pre><code>Intent myReceivingIntent = getIntent();
String myPREFName = myReceivingIntent.getStringExtra("prefName");

mySharedPreferences = getSharedPreferences(myPREFName, 0);

applySavedPreferences();
</code></pre>

<p>In the applySavedPreferences method:</p>

<pre><code> String addressValue = mySharedPreferences.getString("address", "Jack Smith");
String contactValue = mySharedPreferences.getString("contact", "Jack Smith");   

addressTV.setText(addressValue);
contactTV.setText(contactValue);
</code></pre>
