title: how to call fragment from Navigation drawer?
body: <p>please help me i am new to android.
  I can display toast by clicking item in navigation drawer but how can i open new fragment from navigation drawer. </p>
  
  <p>My code in NavigationDrawerFragment is</p>
  
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View layout = inflater.inflate(R.layout.fragment_navigation_drawer, container, false);
          recyclerView = (RecyclerView) layout.findViewById(R.id.drawerList);
          adapter = new EduAdapter(getActivity(), getData());
          recyclerView.setAdapter(adapter);
          recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
          recyclerView.addOnItemTouchListener(new RecyclerTouchListener(getActivity(), recyclerView, new ClickListener() {
              @Override
              public void onClick(View view, int position) {
                  Toast.makeText(getActivity(), "On click  " + position, Toast.LENGTH_LONG).show();
  
              mDrawerLayout.closeDrawer(GravityCompat.START);
                  Toast.makeText(getActivity(), "On Long click  " + position, Toast.LENGTH_LONG).show();
  
              }
  
              @Override
              public void onLongClick(View view, int position) {
                  Toast.makeText(getActivity(), "On long click  " + position, Toast.LENGTH_LONG).show();
              }
          }));
          return layout;
      }
  </code></pre>
  
  <p>and in main activity is : </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  
      private Toolbar toolbar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_appbar);
  
          toolbar = (Toolbar) findViewById(R.id.app_bar);
          setSupportActionBar(toolbar);
  
          getSupportActionBar().setDisplayShowHomeEnabled(true);
          NavigationDrawerFragment drawerFragment =
                  (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
          drawerFragment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), toolbar);
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  </code></pre>
  
  <p>please help me to open new fragment from drawer as i can only display toast.
  i wqas following Slidenerd Material design Video .</p>