title: Fragment doesn't show
body: <p>I'm trying to use the navigation bar and open new fragments with it.
  I've looked through every question about it and watched a lot of YouTube videos... but I can't get why the fragment content is not showing up.
  Here is some code:</p>
  
  <p><code>MainActivity</code> class:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity
          implements NavigationView.OnNavigationItemSelectedListener, MainFragment.OnFragmentInteractionListener, OtherFragment.OnFragmentInteractionListener {
  
      NavigationView navigationView;
      Toolbar toolbar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
           toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          MainFragment frag = new MainFragment();
          FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
          ft.replace(R.id.fragment_container, frag);
          ft.commit();
  
          FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
          fab.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                          .setAction("Action", null).show();
              }
          });
  
          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) findViewById(R.id.nav_view);
          navigationView.setNavigationItemSelectedListener(this);
      }
  
      @SuppressWarnings("StatementWithEmptyBody")
      @Override
      public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
          if (id == R.id.nav_camera) {
              MainFragment frag = new MainFragment();
              FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
              ft.replace(R.id.fragment_container, frag).commit();
          } else if (id == R.id.nav_gallery) {
              OtherFragment frag = new OtherFragment();
              FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
              ft.replace(R.id.fragment_container, frag);
              ft.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);
          if(drawer!=null)
          drawer.closeDrawer(GravityCompat.START);
          return true;
      }
  
      @Override
      public void onFragmentInteraction(Uri uri) {
  
      }
  
  }
  </code></pre>
  
  <p><code>MainFragment</code> class (very equal to <code>OtherFragment</code> class):</p>
  
  <pre><code>public class MainFragment extends Fragment {
      // TODO: Rename parameter arguments, choose names that match
      // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
      private static final String ARG_PARAM1 = "param1";
      private static final String ARG_PARAM2 = "param2";
  
      // TODO: Rename and change types of parameters
      private String mParam1;
      private String mParam2;
  
      private OnFragmentInteractionListener mListener;
  
      public MainFragment() {
          // Required empty public constructor
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_main, container, false);
      }
  
      // TODO: Rename method, update argument and hook method into UI event
  
      /**
       * This interface must be implemented by activities that contain this
       * fragment to allow an interaction in this fragment to be communicated
       * to the activity and potentially other fragments contained in that
       * activity.
       * &lt;p&gt;
       * See the Android Training lesson &lt;a href=
       * "http://developer.android.com/training/basics/fragments/communicating.html"
       * &gt;Communicating with Other Fragments&lt;/a&gt; for more information.
       */
      public interface OnFragmentInteractionListener {
          // TODO: Update argument type and name
          void onFragmentInteraction(Uri uri);
      }
  }
  </code></pre>
  
  <p><code>app_bar_main.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;FrameLayout
          android:id="@+id/fragment_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/FrameLayout&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="bottom|end"
          android:layout_margin="@dimen/fab_margin"
          app:srcCompat="@android:drawable/ic_dialog_email" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>fragment_main.xml:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="de.package.test.MainFragment"&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:text="@string/hello_blank_fragment" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>I don't get any error codes.
  I would be sooo happy if you could help me ;)</p>