title: Switching between Fragment view
body: <p>The standard way to declare fragments in a xml layout file is </p>
  
  <pre><code>&lt;LinearLayout ...&gt; 
      &lt;fragment class="com.example.SomeFragment"
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>where SomeFragment is a java class defined like </p>
  
  <pre><code>class SomeFragment extends Fragment { 
      ... 
  }
  </code></pre>
  
  <p>Lets say, I have 3 fragments; fragment1, fragment2, and fragment3. When the user launches the app, I show them fragment1, and when they click on a button, I replace the fragment1 with fragment2, etc. </p>
  
  <p>What is the best approach to define the 3 fragments in a single layout xml file?</p>