title: Refresh activity without re-opening it?
body: <p>I implemented a button in my app that clears all sharedpreferences using this code:</p>
  
  <pre><code>context.getSharedPreferences("bifrostPrefs", 0).edit().clear().commit();
  </code></pre>
  
  <p>Now the problem is that whenever I use the button, I then need to exit the activity and re-open it to see results. I tried solving this by simply making the button re-open the activity with this code:</p>
  
  <pre><code>Intent reOpen = new Intent (Bifrost.this, Bifrost.class);
  startActivity(reOpen);
  </code></pre>
  
  <p>My idea seemed smart until I noticed that if I re-open the activity, I then need to press the back button twice to get back to main activity. So I did some reserach and found this code:</p>
  
  <pre><code>finish();
  startActivity(getIntent());
  </code></pre>
  
  <p>This now works fine, the activity gets refreshed and then I only need to click the back button once. But is there another way to refresh activity without it "flashing" in and out? As you know, everytime you open a new activity, it flashes in and out so the app lags for a second. Is there a way to refresh an activity by bypassing this?</p>