title: How to replace fragment C with fragment A when back button is pressed?
body: <p>My scenario : Activity 1 consists of Fragments A-> B-> C. All the fragments are added using this code : </p>
  
  <pre><code>        FragmentManager fm = getSupportFragmentManager();
          FragmentTransaction ft = fm.beginTransaction();
          ft.replace(R.id.content, fragment, TAG);
          ft.addToBackStack(TAG);
          ft.commit();
  </code></pre>
  
  <p>Now, from fragment C, I want to directly return to Fragment A. Therefore, I've commented <code>ft.addToBackStack(TAG)</code> while adding Fragment C. So when I press back button from C I directly get Fragment A on the screen.</p>
  
  <p>However, Fragment C is not replaced by A. In fact, both the fragments are visible. How do I solve this issue? </p>