title: issue with replacing Fragment views in Navigation drawer
body: <p>I am using the android Navigation drawer template and fragments to display different views. </p>
  
  <p>as the normal there is a MainActivity, activity_main.xml and content_main.xml generated automatically.</p>
  
  <p>I have created two java classes; MusicFragment and MainFragment and of course the layout files which I have content inside.</p>
  
  <p>When I run the app the activity_main is the default layout launched which I have welcome content displaying, I am using the Navigation drawer to navigate to my MusicFragment and MainFragment, this code I using to replace the current view in the onNavigationItemSelected method is;</p>
  
  <pre><code> if (id == R.id.nav_camara) {
  
          fm.beginTransaction().replace(R.id.content_frame, new MainFragment()).commit();
  
  
      } else if (id == R.id.nav_gallery) {
  
          fm.beginTransaction().replace(R.id.content_frame, new MusicFragment()).commit();
  </code></pre>
  
  <p>these both work fine with replacing each other although I have a big problem, when I select the nav drawer and hit the camera option it shows the fragment view but does not replace the content from activity_main it shows the fragment content on top of the content_main and doesn't replace it. </p>
  
  <p>This is my MainActivity:</p>
  
  <pre><code>package com.justmikey.justmik;
  
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v4.app.FragmentManager;
  import android.support.v7.internal.widget.ButtonBarLayout;
  import android.text.method.ScrollingMovementMethod;
  import android.view.View;
  import android.support.design.widget.NavigationView;
  import android.support.v4.view.GravityCompat;
  import android.support.v4.widget.DrawerLayout;
  import android.support.v7.app.ActionBarDrawerToggle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.Button;
  import android.widget.TextView;
  import JustMikey.Fragments.MainFragment;
  import JustMikey.Fragments.MusicFragment;
  
  public class MainActivity extends AppCompatActivity
      implements NavigationView.OnNavigationItemSelectedListener {
  
  //create a media player object called mp
  MediaPlayer mp;
  //declare my buttons play, pause and stop
  Button play, pause,stop;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //Set the textView scrollMain to scrollable
      TextView tv = (TextView) findViewById(R.id.scrollMain);
      tv.setMovementMethod(new ScrollingMovementMethod());
  
      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);
  }
  
  
  
  
  @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) {
      android.app.FragmentManager fm = getFragmentManager();
  
      int id = item.getItemId();
  
      if (id == R.id.nav_camara) {
  
          fm.beginTransaction().replace(R.id.content_frame, new MainFragment()).commit();
  
  
      } else if (id == R.id.nav_gallery) {
  
          fm.beginTransaction().replace(R.id.content_frame, new MusicFragment()).commit();
  
  
      } 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) {
  
      }
  
      DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
      drawer.closeDrawer(GravityCompat.START);
      return true;
  }
  }
  </code></pre>
  
  <p>content_main.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"     android:layout_width="match_parent"
  android:layout_height="match_parent"         android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/app_bar_main"
  tools:context=".MainActivity"
  android:background="#dbe4eb"&gt;
  
  
  
  &lt;FrameLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/content_frame"&gt;
  
      &lt;ImageView
          android:layout_width="355dp"
          android:layout_height="wrap_content"
          android:src="@drawable/jmmain"
          android:id="@+id/imageView2"
          android:layout_gravity="center_horizontal|top"
          android:layout_alignRight="@+id/content_frame"
          android:layout_alignEnd="@+id/content_frame" /&gt;
  
      &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="274dp"
          android:text="hello hello hello hello hello hello hello hello"
          android:id="@+id/scrollMain"
          android:layout_gravity="center_horizontal|bottom"
          android:layout_alignBottom="@+id/scrollView"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true"
          android:layout_marginBottom="28dp"
          android:layout_alignParentRight="true"
          android:layout_alignParentEnd="true"
          android:background="#ffffff"
          android:padding="10dp"
          /&gt;
  
      &lt;ScrollView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/scrollView"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true"
          android:layout_gravity="center"&gt;
  
      &lt;/ScrollView&gt;
  
  
  &lt;/FrameLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>