title: How to refresh SharedPreferences in android when restore from a file?
body: <p>I backup the SharedPreferences xml file to the SD card, from the file</p>
  
  <pre><code>File taskExceptionFile = new File(Environment.getDataDirectory()
                  + "/data/" + packageName + "/shared_prefs/" + TaskAction.SHARED_PREF_TITLE_TASK_EXCEPTION + ".xml");
  </code></pre>
  
  <p>however, when I restore the file, if the file has been open by </p>
  
  <pre><code>SharedPreferences sp = context.getSharedPreferences(TaskAction.SHARED_PREF_TITLE_TASK_EXCEPTION, 0);
  </code></pre>
  
  <p>before restoring, the SharedPreferences seems to have a cache, I use Root Explorer to see the file after restoring, the values are indeed the values from the backup file, but when I use</p>
  
  <pre><code>sp.getInt(TaskAction.SHARED_PREF_TASK, 0)
  </code></pre>
  
  <p>to get the value, the value is not the new value from the backup file, it returns the default value 0. I force stop my app, and reenter my app, the values are the new values.</p>
  
  <p>So, I want to ask how to refresh the SharedPreferences immediately when I restore the file, so that I can get the new value?</p>
  
  <p>Sorry for my poor English~~~</p>