title: FragmentTransaction replace method doesn't work properly
body: <p>I have a bug with replacing fragments inside <code>FrameLayout</code> container.
  When  app is started first time everything is Ok but when I hide app and then resume it fragments start overlap each other when <code>FragmentTransaction.replace</code> method is called</p>
  
  <p>I've seen almost all stackoverflow questions about such issues but I can't resolve this issue</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;FrameLayout
     android:id="@+id/frame"
     android:layout_width="match_parent"
     android:layout_height="match_parent"&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Add initial fragment:</p>
  
  <pre><code>getSupportFragmentManager().beginTransaction()
                      .add(R.id.frame, RequestFragment.newInstance(), REQUEST_FRAGMENT_TAG)
                      .commit();
  </code></pre>
  
  <p>Replace:</p>
  
  <pre><code>FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
  switch (menuItem.getItemId()) {
      case R.id.request:
          ft.replace(R.id.frame, RequestFragment.newInstance(), REQUEST_FRAGMENT_TAG);
          ft.commit();
          return true;
      case R.id.finished:
          ft.replace(R.id.frame, FinishedFragment.newInstance(), FINISHED_FRAGMENT_TAG);
          ft.commit();
          return true;
      case R.id.questions:
          ft.replace(R.id.frame, QuestionsFragment.newInstance(), QUESTIONS_FRAGMENT_TAG);
          ft.commit();
          return true;
      default:
          return true;
  }
  </code></pre>