title: Navigation Drawer and MapFragment
body: <p>I'd like to know what is the correct approach to implement a MapFragment with a navigation drawer. I already had this working fine, but I have been reading some documentation and maybe it can cause troubles in the future.</p>
  
  <p>So, my main class where the navigation drawer has been implemented is a very normal one, with the following <code>selectItem()</code> method:</p>
  
  <pre><code>HomeActivity extends Activity{
  
  //...
  //Stuff like onCreate(), etc.
  //...
  
  private void selectItem(int position) {
      if (position == 0) {  //Position 0 is the map option in the navigationDrawer
          Fragment fragment = new MapaFragment();
          FragmentManager fragmentManager = getFragmentManager();
          fragmentManager.beginTransaction()
                  .replace(R.id.content_frame, fragment).commit();
      }
      mDrawerList.setItemChecked(position, true);
      setTitle(listaElementosDrawer[position]);
      mDrawerLayout.closeDrawer(mDrawerList);
      }
  }
  </code></pre>
  
  <p>MapaFragment, which is the inflated fragment in the main activity, is as follows:</p>
  
  <pre><code>public class MapaFragment extends Fragment {
  
  public MapaFragment() {
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_map, container,
              false);
      return rootView;
  }
  }
  </code></pre>
  
  <p>And, <code>fragment_map.xml</code> which is inflated in <code>MapaFragment</code> is like this:</p>
  
  <pre><code>&lt;RelativeLayout 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="com.moictab.decanias.MapActivity$PlaceholderFragment" &gt;
  
  &lt;fragment
      android:id="@+id/map"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      class="com.google.android.gms.maps.MapFragment" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Notice that this is a mapFragment inside of a RelativeLayout, and it is already working well. But, if I remove the RelativeLayout and I left only the mapFragment, it crashes cause I'm inflating a fragment inside of a fragment. So, there is the questions:</p>
  
  <ul>
  <li>Why does it crash when it inflates the mapFragment but it does NOT crash when inflating the RelativeLayout with the mapFragment inside? Isn't it essentially the same?</li>
  <li>What is the correct approach to implement something like that?</li>
  </ul>