title: Display Two Fragments at the same time
body: <p>From <code>FragmentPagerAdapter</code> in <code>case 0</code> I instantiated  <code>fragment A</code> this fragment I wanted to display display two fragments inside <code>frag A</code>. The view is not displaying. MyFragmentPagerAdapter is called by the main class to populate the viewpager.</p>
  
  <pre><code> MyFragmentPagerAdapter extends FragmentPagerAdapter{
  
     @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
   View rootView = inflater.inflate(R.layout.main, container, false);
  final int MARGIN = 16;
  leftFrag = new RoundedColourFragment(con.getResources().getColor(
          R.color.android_green), 1f, MARGIN, MARGIN / 2, MARGIN, MARGIN);
  rightFrag = new RoundedColourFragment(con.getResources().getColor(
          R.color.honeycombish_blue), 2f, MARGIN / 2, MARGIN, MARGIN,
          MARGIN);
  
  FragmentTransaction ft = getFragmentManager().beginTransaction();
  ft.add(R.id.fragg, leftFrag, "left");
  ft.add(R.id.fragg2, rightFrag, "right");
  ft.commit();
  
  return rootView;
  } 
  }
  </code></pre>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/root"
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
       &lt;FrameLayout 
  
              android:id="@+id/fragg"
              android:layout_weight="2"
              android:layout_width="0dp"
              android:layout_height="match_parent" /&gt;
  
        &lt;FrameLayout
  
              android:id="@+id/fragg2"
              android:layout_weight="2"
              android:layout_width="0dp"
              android:layout_height="match_parent" /&gt;
  
  
  &lt;android.support.v4.view.ViewPager
          android:id="@+id/pager"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
      /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>