title: Frame layout inside a fragment
body: <p>I am working in a Fragment. it contains 2 Buttons and a FrameLayout: </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="fragments.Fragment_Book_A_Cam"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:weightSum="2"&gt;
  
          &lt;Button
              android:id="@+id/bt_Public"
              android:layout_width="0dp"
              android:layout_height="60dp"
              android:layout_weight="1"
              android:background="@drawable/red"
              android:text="Public Jobs "
              android:textColor="#FFFFFF" /&gt;
  
          &lt;Button
              android:id="@+id/bt_Active"
              android:layout_width="0dp"
              android:layout_height="60dp"
              android:layout_weight="1"
              android:background="@drawable/black"
              android:text="Active Jobs"
              android:textColor="#FFFFFF" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;FrameLayout
          android:id="@+id/Fragment_Jobs_BookACam"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/FrameLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to load another Fragment in the FrameLayout on a Button click and don't want to replace the main FrameLayout.</p>
  
  <p>All the methods I have used either crash or replace the main Fragment.</p>
  
  <pre><code>bt_Public.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        //                fragment = new Fragment_MyCloudVideo();
        //                FragmentManager fragmentManager = ;
        //                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        //    fragmentTransaction.replace(R.id.Fragment_MyVideos, fragment);
  
        //                fragmentTransaction.commit();
  
        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        Fragment_Public_Jobs fragment = new Fragment_Public_Jobs();
        fragmentTransaction.addToBackStack("xyz");
        fragmentTransaction.hide(Fragment_Book_A_Cam.this);
        fragmentTransaction.add(android.R.id.content, fragment);
        fragmentTransaction.commit();
  
      }
    });
  </code></pre>