title: Removing fragments from an activity
body: <pre><code>FragmantClass rSum = new FragmantClass();
  getSupportFragmentManager().beginTransaction().remove(rSum).commit();       
  </code></pre>
  
  <p>I am trying to remove this fragment, when i load switch another fragment. The above fragment does not get removed. Here is the method i am calling to switch fragments.</p>
  
  <pre><code>public void switchContent(Fragment fragment) {
      FragmantClass rSum = new FragmantClass();
      getSupportFragmentManager().beginTransaction().remove(rSum).commit();
      mContent = fragment;
      getSupportFragmentManager()
          .beginTransaction()
          .replace(R.id.content_frame, fragment)
          .commit();
      getSlidingMenu().showContent();
  }
  </code></pre>