title: load fragment from Activity layouts overlapping
body: <p>I want to load fragment layout button click on activity. When I do this it successfully redirects to the fragment but the thing is the fragment layout overlapped with the activity layout. Please help me.</p>
  
  <p>This is my Activity layout</p>
  
  <pre><code>&lt;RelativeLayout 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="info.androidhive.materialtabs.fragments.OneFragment"&gt;
  
  &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="50dp"
      android:id="@+id/linearLayout7"
      android:layout_alignTop="@+id/linearLayout6"
      android:layout_toEndOf="@+id/linearLayout6"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/textView14"
          android:layout_marginLeft="25dp"
          android:layout_marginTop="1dp"
          android:layout_marginRight="10dp" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/textView15"
          android:layout_marginLeft="200dp" /&gt;
  &lt;/LinearLayout&gt;
  &lt;FrameLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/fragment_container"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>This my fragment layout</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  tools:context="info.androidhive.materialtabs.fragments.OneFragment"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="three"
      android:textSize="40dp"
      android:textStyle="bold"
      android:id="@+id/Add"
      android:layout_centerInParent="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>The ThreeFragment extends Fragment and in Activity inside button click this is is how I load the fragement. No errors occur, the only thing is the views are overlapping.</p>
  
  <pre><code>  AddPlan.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              FragmentManager fragmentManager = getSupportFragmentManager();
              FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
              Fragment fragment = new FourFragment();
              fragmentTransaction.add(R.id.fragment_container, fragment);
              fragmentTransaction.commit();
  
          }
  
      });
  </code></pre>