title: how to solve fragment replacing issue
body: <p>it is activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/mainnewfeedcontainer"
  
      &gt;
  
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_above="@+id/newsfeed_footer"
          android:id="@+id/container_content"
          android:background="?android:windowBackground"
  
  
          &gt;
  
  
      &lt;android.support.v4.widget.DrawerLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/drawer_layout"
          android:fitsSystemWindows="true"
          tools:openDrawer="start"
  
          &gt;
  
      &lt;include
          layout="@layout/app_bar_main"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          /&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/nav_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="end"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/nav_header_main"
          app:menu="@menu/activity_main_drawer"
          app:itemTextColor="@color/white"
          android:background="@color/black"
          app:theme="@style/NavigationTheme"
  
          /&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  
      &lt;/FrameLayout&gt;
  
     &lt;LinearLayout
      android:id="@+id/newsfeed_footer"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:background="@drawable/myprofile_rectangleshape"
      android:gravity="center"
      android:orientation="horizontal"
      android:weightSum="5"
      &gt;
  
      &lt;RelativeLayout
          android:layout_width="wrap_content"
          android:layout_height="50dp"
          android:layout_weight="1"
          android:gravity="center"
          android:id="@+id/feedfunctionality"
  
  
          &gt;
  
          &lt;ImageView
              android:layout_width="20dp"
              android:layout_height="30dp"
              android:layout_weight="1"
              android:src="@drawable/feed_icons"
              android:gravity="center"
              android:text="Feed"
  
              android:id="@+id/feedicon"
              android:paddingTop="2dp"
              android:textSize="12sp"
              android:layout_centerHorizontal="true"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Feed"
              android:layout_weight="1"
              android:textColor="@color/white"
              android:gravity="center"
              android:id="@+id/feedicon_text"
              android:layout_centerHorizontal="true"
              android:layout_below="@+id/feedicon"
              /&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="30dp"
          android:layout_height="50dp"
          android:layout_weight="1"
          android:gravity="center"
          android:id="@+id/discoverfunctionality"
  
  
          &gt;
  
          &lt;ImageView
              android:layout_width="20dp"
              android:layout_height="30dp"
              android:layout_weight="1"
              android:src="@drawable/discover_icon"
              android:gravity="center"
              android:paddingTop="2dp"
              android:textSize="12sp"
              android:layout_centerHorizontal="true"
  
              android:id="@+id/discovericon"
  
              android:text="Feed"
              /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Discover"
              android:layout_weight="1"
              android:textColor="@color/white"
              android:gravity="center"
              android:layout_centerHorizontal="true"
              android:layout_below="@+id/discovericon"
              android:id="@+id/discover_text"
  
              /&gt;
  
      &lt;/RelativeLayout&gt;
  
  
      &lt;RelativeLayout
          android:layout_width="30dp"
          android:layout_height="50dp"
          android:layout_weight="1"
          android:gravity="center"
          android:id="@+id/matchfunctionality"
  
  
          &gt;
  
          &lt;ImageView
              android:layout_width="20dp"
              android:layout_height="30dp"
              android:layout_weight="1"
              android:src="@drawable/matchicon"
              android:gravity="center"
              android:text="Feed"
              android:layout_centerHorizontal="true"
  
              android:paddingTop="2dp"
              android:textSize="12sp"
              android:id="@+id/matchicon"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Match"
              android:layout_weight="1"
              android:textColor="@color/white"
              android:gravity="center"
              android:layout_centerHorizontal="true"
              android:id="@+id/match_text"
              android:layout_below="@+id/matchicon"
              android:layout_alignParentBottom="true"
  
  
              /&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="30dp"
          android:layout_height="50dp"
          android:layout_weight="1"
          android:layout_gravity="center"
          android:gravity="center"
          &gt;
  
          &lt;ImageView
              android:layout_width="20dp"
              android:layout_height="30dp"
              android:layout_weight="1"
              android:src="@drawable/chaticon"
              android:gravity="center"
              android:paddingTop="2dp"
              android:layout_centerHorizontal="true"
              android:textSize="12sp"
              android:id="@+id/chaticon"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Chat"
              android:layout_weight="1"
              android:textColor="@color/white"
              android:gravity="center"
              android:layout_centerHorizontal="true"
              android:layout_below="@+id/chaticon"
  
              /&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="30dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="center"
  
          &gt;
  
          &lt;ImageView
              android:layout_width="20dp"
              android:layout_height="30dp"
              android:layout_weight="1"
              android:src="@drawable/notificationicon"
              android:gravity="center"
              android:text="Feed"
              android:paddingTop="2dp"
              android:layout_centerHorizontal="true"
              android:textSize="12sp"
              android:id="@+id/noticeicon"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Notice"
              android:layout_weight="1"
              android:textColor="@color/white"
              android:layout_centerHorizontal="true"
              android:gravity="center"
              android:layout_below="@+id/noticeicon"
  
  
  
  
              /&gt;
  
      &lt;/RelativeLayout&gt;
  
     &lt;/LinearLayout&gt;
  
  
  
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>there is framelayout ,i want to replace page with another page through fragment except bottom layout</p>
  
  <p>this is MainActivity.class</p>
  
  <pre><code>fragmentTransaction=fragmentManager.beginTransaction();
                  Fragment  fragmentdiscover=new Fragmentdiscover();
  
  
                  fragmentTransaction.replace(R.id.container_content,fragmentdiscover);
                  fragmentTransaction.addToBackStack(null);
  
                  fragmentTransaction.commit();
  </code></pre>
  
  <p>page is replacing but not showing properly ,<a href="https://i.stack.imgur.com/lysTO.png" rel="nofollow noreferrer">some part is cropping of header</a></p>
  
  <p>Thanks in advance</p>