SharedPreferences not able to set
<p>Whats wrong with the below code</p>

<p>I am not able to retrieve a simple setting saved in SharedPreferences. s1 is always "". What it the small mistake I am doing >
        SharedPreferences sp = getSharedPreferences("MyTestPref", 0);</p>

<pre><code>    String s = "Item1";
    sp.edit().putString("VAL", (s));
    sp.edit().apply(); //also tried commit
    String s1 = (sp.getString("VAL", ""));
</code></pre>
