issue with SharedPreferences
<p>i want to store string in memory through sharepreferance but there are some problem raise that could not store in memory can you please let me know how can i solve this?
any permission needed? </p>

<p><strong>Code::</strong></p>

<pre><code>SavePreferences("MEM1", LanguageSelcted); 
LoadPreferences();
</code></pre>

<p><strong>Method::</strong> </p>

<pre><code>public void SavePreferences(String key, String value) {
            try {
                SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
                SharedPreferences.Editor editor = sharedPreferences.edit();
                editor.putString(key, value.trim());
                editor.commit();
            } catch (Exception e) {

            e.printStackTrace();

            }

private void LoadPreferences() {
        try {
            SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
            LanguageSelection = sharedPreferences.getString("MEM1", "");
            Log.i(TAG, "LanguageSelection is :&gt;&gt;&gt;" + LanguageSelection);
            Toast.makeText(getBaseContext(), "LanguageSelection is :&gt;&gt;&gt;" + LanguageSelection, Toast.LENGTH_LONG).show();
            /*
             * textSavedMem1.setText(strSavedMem1);
             * textSavedMem2.setText(strSavedMem2);
             */
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
</code></pre>
