title: Using Google Map Fragment in onCreateView() with Tabs
body: <p>I have my <code>FragmentActivity</code> extends <code>ActionBar.TabListener</code> with two tabs.</p>
  
  <p>In my first tab I'm trying to display <code>GoogleMap</code>.</p>
  
  <p>How can I do it in my <code>onCreateView()</code> method? This is my code:</p>
  
  <pre><code>public class MapFragment extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.fragment_map, container, false);
          this.ctx = container.getContext();
  
          GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
  
          return rootView;
      }
  }
  </code></pre>
  
  <p>This code get me an errore on <code>getMap()</code>:</p>
  
  <blockquote>
    <p>The method getMap() is undefined for the type MapFragment</p>
  </blockquote>
  
  <p>This is my XML layout fragment_map.xml</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="${relativePackage}.${activityClass}" &gt;
  
      &lt;fragment
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.MapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>