title: Android replacing fragment doesn't remove text field data
body: <p>Lets say I have 2 fragments, one of which has a text input field.</p>
  
  <p>I switch between my fragments in the main activity with this:</p>
  
  <pre><code>public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
          if (id == R.id.nav_new) {
              FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
  
              fragmentTransaction.replace(R.id.fragment_container, NewFragment(), fragment.getClass().getSimpleName())
                          .addToBackStack(Integer.toString(id))
                          .commit();
          } ...
  </code></pre>
  
  <p>Notice I'm using framentTransactions <code>replace</code> method</p>
  
  <p>On the current fragment with the input box, I type in some text. Then I use the nav bar to switch to a new fragment. I would expect that because I'm using <code>replace</code>, the old fragment no longer exists.</p>
  
  <p>I navigate to the new fragment fine, but when I press the back button, the old fragment still has the text that I typed in previously</p>
  
  <p>Why would this happen when using <code>replace</code>? Am I misunderstanding how fragment transactions work?</p>
  
  <p>Does the <code>onCreateView</code> method of the fragment not get called again when I press back, thus essentially resetting the fragment?</p>