title: Fragment hides drawer menu
body: <p>The onViewCreate method of Chapter1Fragment class (extending from android.app.Fragment) is returning an object of a class which is subclass of android.opengl.GLSurfaceView</p>
  
  <p>This fragment appears fine on the activity. But the problem is that the drawer navigation view does hides behind this fragment. Please suggest how the drawer menu can be fixed?</p>
  
  <p>here is the code of onViewCreate</p>
  
  <pre><code>@Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, 
  Bundle savedInstanceState) {
      int chapterNumber = 1;
      getActivity().setTitle(R.string.txt_chap1);
      mPageFlipView = new PageFlipView(getActivity(), chapterNumber);
      mGestureDetector = new GestureDetector(getActivity(), this);
  
      mPageFlipView.setOnTouchListener(new View.OnTouchListener(){
  
  
          @Override
          public boolean onTouch(View view, MotionEvent motionEvent) {
              if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
                  mPageFlipView.onFingerUp(motionEvent.getX(), motionEvent.getY());
                  return true;
              }
  
              return mGestureDetector.onTouchEvent(motionEvent);
          }
      });
      return mPageFlipView;
  }
  </code></pre>
  
  <p>There is another Fragment HomeFragment which invokes the following code to make Chapter1Fragment appear</p>
  
  <pre><code>Chapter1Fragment fragment = new Chapter1Fragment();
  FragmentManager fragmentManager = getFragmentManager();
      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
      fragmentTransaction.replace(R.id.frameLayout, fragment);
      fragmentTransaction.commit();
  </code></pre>
  
  <p>Here is the xml file that is passed to setContentView() of MainActivity's onCreate()</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout 
  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:id="@+id/drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  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="start"
      android:fitsSystemWindows="true"
  
      app:menu="@menu/activity_main_drawer" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Here is the app_bar_main.xml from layout directory</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 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"
  tools:context="viento.com.bookapp.MainActivity"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;include layout="@layout/content_main" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Here is the content_main.xml from layout directory</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/frameLayout"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"
  /&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8BVtA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8BVtA.jpg" alt="screen shot of the fragment hiding the navigation drawer menu"></a></p>