title: Navigation Drawer is not switching fragments on clicking the menu items
body: <p>I am simply using the default code that Android Studio provides on creating a navigation drawer activity. </p>
  
  <pre><code>@Override
  public void onNavigationDrawerItemSelected(int position) {
      // update the main content by replacing fragments
      FragmentManager fragmentManager = getFragmentManager();
      switch(position){
          case 0:
              fragmentManager.beginTransaction()
                      .replace(R.id.container, new PlaceholderFragment())
                      .commit();
              Toast.makeText(this,position+"",Toast.LENGTH_SHORT).show();
          case 1:
              fragmentManager.beginTransaction()
                      .replace(R.id.container, new ProfileInfoFragment())
                      .commit();
              Toast.makeText(this,position+"",Toast.LENGTH_SHORT).show();
      }
  
  }
  </code></pre>
  
  <p>All I want to do is to load 2 different fragments when 2 different items are selected. The toasts give the correct positions but fragments are not switching.</p>
  
  <p>PlaceholderFragment.java:</p>
  
  <pre><code>import android.app.Activity;
  import android.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  
  public class PlaceholderFragment extends Fragment {
  /**
   * The fragment argument representing the section number for this
   * fragment.
   */
  private static final String ARG_SECTION_NUMBER = "section_number";
  
  /**
   * Returns a new instance of this fragment for the given section
   * number.
   */
  public static PlaceholderFragment newInstance(int sectionNumber) {
      PlaceholderFragment fragment = new PlaceholderFragment();
      Bundle args = new Bundle();
      args.putInt(ARG_SECTION_NUMBER, sectionNumber);
      fragment.setArguments(args);
      return fragment;
  }
  
  public PlaceholderFragment() {
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_main, container, false);
      return rootView;
  }
  
  @Override
  public void onAttach(Activity activity) {
      super.onAttach(activity);
      ((MainActivity) activity).onSectionAttached(
              getArguments().getInt(ARG_SECTION_NUMBER));
  }
  }
  </code></pre>
  
  <p>ProfileInfoFragment.java:</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class ProfileInfoFragment extends Fragment {
  
      private static final String ARG_SECTION_NUMBER = "section_number";
  
      public static ProfileInfoFragment newInstance(int sectionNumber) {
          ProfileInfoFragment fragment = new ProfileInfoFragment();
          Bundle args = new Bundle();
          args.putInt(ARG_SECTION_NUMBER, sectionNumber);
          fragment.setArguments(args);
          return fragment;
      }
  
      public ProfileInfoFragment() {
      }
  
      //Setting up the fragment
      @Override
      public void onAttach(Activity activity) {
          super.onAttach(activity);
          ((MainActivity) activity).onSectionAttached(
                  getArguments().getInt(ARG_SECTION_NUMBER));
      }
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_profile_info, container, false);
          return rootView;
      }
  }
  </code></pre>