title: Replaced Fragments are still active
body: <p>I am writing an Android App using the support version of Fragments (android.support.v4.app.Fragment).</p>
  
  <p>I have a strange bug in my code and I dont know how to fix it.
  When I replace a Fragment with an other one, the replaced one is still active and receiving touch events. A tap on the location of a Button from the replaced Fragment will still fire an OnClick Event.</p>
  
  <p>I really dont know how to fix this. Can anybody help me?</p>
  
  <p><strong>Java Code</strong></p>
  
  <pre><code>Fragment newFragment = new LoginActivityRegisterFragment();
  
  ...
  
  FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.replace(R.id.login_fragment, newFragment);
  ft.commit();
  
  ...
  </code></pre>
  
  <p><strong>XML Layout</strong></p>
  
  <pre><code>...
  
  &lt;fragment
      class="de.myapp.fragments.LoginActivityMainFragment"
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/login_fragment" /&gt;
  
  ...
  </code></pre>