title: Shared Preferences is not working, android, kotlin?
body: <p>I'm trying to save uuid in application memory. To do this I perform to use Shared Preferences and use this guide from <a href="https://developer.android.com/training/data-storage/shared-preferences#kotlin" rel="nofollow noreferrer">developer.android.com</a>
  From this place exactly <a href="https://developer.android.com/training/data-storage/shared-preferences#WriteSharedPreference" rel="nofollow noreferrer">PLACE</a></p>
  <pre><code>private fun setPreferences(response: JSONObject) {
          val sharedPref = this.getPreferences(Context.MODE_PRIVATE) ?: return
          with(sharedPref.edit()) {
              putString(
                  getString(R.string.PREFERENCE_FILE_KEY),
                  response.get(&quot;uuid&quot;).toString()
              )
              apply()
          }
  </code></pre>
  <p>This is my strings.xml file</p>
  <pre><code>&lt;resources&gt;
      &lt;string name=&quot;app_name&quot;&gt;Book of recipes&lt;/string&gt;
      &lt;string name=&quot;prompt_login&quot;&gt;Login&lt;/string&gt;
      &lt;string name=&quot;prompt_password&quot;&gt;Password&lt;/string&gt;
      &lt;string name=&quot;prompt_confirm_password&quot;&gt;Confirm password&lt;/string&gt;
      &lt;string name=&quot;action_sign_in_short&quot;&gt;Sign in&lt;/string&gt;
      &lt;string name=&quot;have_an_account&quot;&gt;Already have an account?&lt;/string&gt;
      &lt;string name=&quot;dont_have_an_account&quot;&gt;Don\'t have an account?&lt;/string&gt;
      &lt;string name=&quot;rabbits_with_carrots&quot;&gt;Rabbits with carrots&lt;/string&gt;
      &lt;string name=&quot;login_error&quot;&gt;Login must be 4–12 characters long&lt;/string&gt;
      &lt;string name=&quot;password_error&quot;&gt;Password must be 4–16 characters long&lt;/string&gt;
      &lt;string name=&quot;password_error_reconciliation&quot;&gt;Wrong password re-entered&lt;/string&gt;
      &lt;string name=&quot;characters_check_error&quot;&gt;Field contains invalid characters&lt;/string&gt;
      &lt;string name=&quot;PREFERENCE_FILE_KEY&quot;&gt;&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>After some tries to understand why this isn't working I write this lines of code in my setPreference fun</p>
  <pre><code>println(&quot;UUID : &quot; + response.get(&quot;uuid&quot;).toString())
  
          println(&quot;Preference file key : &quot; + getSharedPreferences(
              getString(R.string.PREFERENCE_FILE_KEY), Context.MODE_PRIVATE))
  
          println(&quot;R string : &quot; + applicationContext.getString(R.string.PREFERENCE_FILE_KEY))
  </code></pre>
  <p>And take as response this :</p>
  <pre><code>I/System.out: UUID : 2c912ffb-01c0-430f-91ca-4ebe7d663225
  I/System.out: Preference file key : android.app.SharedPreferencesImpl@638299c
      R string : 
  </code></pre>
  <p>So question , why I take this result when I trying to get shared preferences and how I can put this uuid in strings.xml file and take it back?</p>