title: SharedPreferences - apply() vs. commit()
body: <p>I know the difference between apply and commit.
  In my case I would like to use <code>commit()</code>, but android suggests me to use <code>apply()</code> because it runs in background and doesn't block the main thread.</p>
  
  <p>Does something like this work if I use apply or is it possible that apply did not update it before calling?</p>
  
  <pre><code>editor.putBoolean("TEST", true)
  editor.apply()
  
  if (preferences.getBoolean("TEST")) {
     //do something
  }
  </code></pre>