title: How to add Map to Android Master/Detail Flow properly?
body: <p>in Android SDK I've created an app with the Master/Detail Flow template and now I'd like to add a Google MapView from the Palette to the activity_item_detail.xml as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/KOsBs.png" rel="nofollow noreferrer">attempt to insert Map into Master/Detail Flow</a></p>
  
  <p>The project compiles, however when I launch the app in the simulator and choose an item on the item list, the app in the simulator crashes. I'm not sure on how to fix this. What are the steps I have to do? Where do I have to add additional code? Same thing happens by the way if I merely add a button to the item_detail_container. Your help is greatly appreciated!</p>
  
  <p>activity_item_detail.xml is as follows: </p>
  
  <pre><code>&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="com.example.ralfmatz.testapplication.ItemDetailActivity"
      tools:ignore="MergeRootFrame"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/app_bar"
          android:layout_width="match_parent"
          android:layout_height="@dimen/app_bar_height"
          android:fitsSystemWindows="true"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/toolbar_layout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              app:contentScrim="?attr/colorPrimary"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"
              app:toolbarId="@+id/toolbar"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/detail_toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  app:layout_collapseMode="pin"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:id="@+id/item_detail_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior" &gt;
  
          &lt;com.google.android.gms.maps.MapView
              android:id="@+id/mapView"
              android:layout_width="match_parent"
              android:layout_height="wrap_content" /&gt;
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical|start"
          android:layout_margin="@dimen/fab_margin"
          app:layout_anchor="@+id/item_detail_container"
          app:layout_anchorGravity="top|end"
          app:srcCompat="@android:drawable/stat_notify_chat" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>