title: Navigation Drawer and FragmentActivity
body: <p>I'm relatively new to android development. Basically, I got a Navigation Drawer. One of the menu will need to open FragmentActivity with viewpager.</p>
  
  <p>here the displayview function</p>
  
  <pre><code> /**
   * Diplaying fragment view for selected nav drawer list item
   * */
  private void displayView(int position) {
      LAST_DISPLAY_POSITION = position;
  
      Fragment fragment = null;
      switch (position) {
      case 0:
          Intent in = new Intent(getApplicationContext(), TestFragmentActivity.class);
          startActivity(in);
          break;
      case 1:
          fragment = new MyAccountFragment();
          break;
      case 2:
          fragment = new TestFragment();
          break;
      case 3:
          fragment = new TestFragment();
          break;
      case 4:
          fragment = new TestFragment();
          break;
  
      default:
          break;
      }
  
      if (fragment != null) {
          FragmentManager fragmentManager = getFragmentManager();
          fragmentManager.beginTransaction()
                  .replace(R.id.frame_container, fragment).commit();
  
          // update selected item and title, then close the drawer
          mDrawerList.setItemChecked(position, true);
          mDrawerList.setSelection(position);
          setTitle(navMenuTitles[position]);
          mDrawerLayout.closeDrawer(mDrawerList);
      } else {
          // error in creating fragment
          Log.e("MainActivity", "Error in creating fragment");
      }
  }
  </code></pre>
  
  <p>as you can see at Case 0, I just calling startactivity to open the view. How can I display the FragmentActivity with the Navigation Drawer?</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>my activity_main.xml</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;!-- Framelayout to display Fragments --&gt;
  
      &lt;FrameLayout
          android:id="@+id/frame_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
      &lt;/FrameLayout&gt;
  
      &lt;!-- Listview to display slider menu --&gt;
  
      &lt;ListView
          android:id="@+id/list_slidermenu"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:background="@color/list_background"
          android:choiceMode="singleChoice"
          android:divider="@color/list_divider"
          android:dividerHeight="1dp"
          android:listSelector="@drawable/list_selector" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>