title: How to implement setDrawerLockMode or disable navigation drawer
body: <p>I have a navigation drawer activity with fragments within it by using a fragment container. I have three fragments within it and I need one of it named <strong>locate_login</strong> to not contain my navigation drawer. </p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity
          implements NavigationView.OnNavigationItemSelectedListener {
  
      DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); //nav drawer
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          //Set the fragment initially
          locate_login fragment = new locate_login();
          android.support.v4.app.FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
          fragmentTransaction.replace(R.id.fragment_container, fragment);
          fragmentTransaction.commit();
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                  this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
          drawer.setDrawerListener(toggle);
          toggle.syncState();
  
          NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
          navigationView.setNavigationItemSelectedListener(this);
  
      }
  
      public void onSelectFragment(View v){ //ignore this
          Fragment newFragment;
  
          if(v == findViewById(R.id.trigger)){
              newFragment = new locate_after();
          }
          else{
              newFragment = new locate_before();
          }
  
          FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
          transaction.replace(R.id.fragment_container, newFragment);
          transaction.addToBackStack(null);
          transaction.commit();
      }
  
  
      @Override
      public void onBackPressed() {
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          if (drawer.isDrawerOpen(GravityCompat.START)) {
              drawer.closeDrawer(GravityCompat.START);
          } else {
              super.onBackPressed();
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @SuppressWarnings("StatementWithEmptyBody")
      @Override
      public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
          if (id == R.id.nav_camera) {
              // Handle the camera action
          } else if (id == R.id.nav_gallery) {
  
          } else if (id == R.id.nav_slideshow) {
  
          } else if (id == R.id.nav_manage) {
  
          } else if (id == R.id.nav_share) {
  
          } else if (id == R.id.nav_send) {
  
          }
  
          drawer.closeDrawer(GravityCompat.START);
          return true;
  
  }
  
  } 
  </code></pre>
  
  <p><strong>Here is my locate_login fragment</strong></p>
  
  <pre><code>public class locate_login extends Fragment{
  
      public locate_login () {
          // Required empty public constructor
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.locate_login, container, false);
          // Inflate the layout for this fragment
          return rootView;
  
      }
  
  }
  </code></pre>
  
  <p>I will highly appreciate it if the answer will be detailed since I'm a beginner on Android Studio.</p>