title: How can I use FragmentManager to display Fragment A, B, C,... in a FrameLayout?
body: <p>Dear StackOverflow people,</p>
  
  <p>I have currently one big issue in my Android application.</p>
  
  <p>I am using Fragments for all my activities and I read all the doc here: <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html" rel="noreferrer">http://developer.android.com/guide/topics/fundamentals/fragments.html</a></p>
  
  <p>My application has now a very cool look on phones and tablets.</p>
  
  <p><strong>My question:</strong></p>
  
  <p>I have a layout displaying a Fragments that is included in a FrameLayout (see screenshot at the bottom)</p>
  
  <p>So, this is a screenshot with Fragment A.</p>
  
  <p>Now, I would like when clicking on a left button, to replace the Fragment A with Fragment B, or C, or...</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;fragment android:name="com.stackoverflow.question.FRAGMENT_A"
              android:id="@+id/list"
              android:layout_weight="1"
              android:layout_width="0dp"
              android:layout_height="match_parent" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>As you can see in my xml, FRAGMENT_A is hardcoded.</p>
  
  <p>Imagine I want to switch between 6 different fragments, what shoulmd I do?
  Put all my 6 Fragments in the XML, or is there a way to replace programmatically FRAGMENT_A with FRAGMENT_B, C, D , E, etc.</p>
  
  <p>Thank a lot for your help.</p>
  
  <p><img src="https://i.stack.imgur.com/ZbdIm.jpg" alt="enter image description here"></p>