title: Remove fragment from navigation
body: <p>I am using Navigation bar, in this there are 5 fragments in my "Main Activity".
  My 5th fragment is Survey page, i want when survey is finished this 5th fragment will remove from my navigation bar. </p>
  
  <p>My code in Main Activity:</p>
  
  <pre><code>private void displayView(int position) {
      // update the main content by replacing fragments
      Fragment fragment = null;
  
      switch (position) {
      case 0:
          fragment = new AFragment();
          break;
      case 1:
          fragment = new BFragment();
          break;
      case 2:
          fragment = new CFragment();
          break;
      case 3:
          fragment = new DFragment();
          break;
      case 4:
          fragment = new SurveyFragment();
          break;
  
      default:
          break;
      }
  
      if (fragment != null) {
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction ft = fragmentManager.beginTransaction();
          ft.replace(R.id.frame_container, fragment);
          ft.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>