title: Google Maps Api V2 in Fragment with ActionBar Tab
body: <p>I have an app with an Action Bar and 3 tabs. When I touch the second Tab I need to show a Google Maps V2 inside the fragment.</p>
  
  <p>This is My MapFragment class:</p>
  
  <pre><code>public class MapFragment extends SupportMapFragment {
  private GoogleMap mMap;
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      View v = inflater.inflate(R.layout.fragment_c, container,
              false);
  
  
      setUpMapIfNeeded(v);
      return v;
  }
  
  private void setUpMapIfNeeded(View v) {
      if (mMap == null) {
          mMap = ((GoogleMap) v.findViewById(R.id.map)).getMap();
          if (mMap != null) {
              setUpMap();
          }
      }
  }
  
  private void setUpMap() {
      mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title(
              "Marker"));
  }
  </code></pre>
  
  <p>}</p>
  
  <p>For this line of code in the setUpMapIfNeeded method :</p>
  
  <pre><code>mMap = ((GoogleMap) view.findViewById(R.id.map)).getMap();
  </code></pre>
  
  <p>I get an error: The method getMap() is undefined for the type GoogleMap</p>
  
  <p>It's the first time I do that and I search for the good way to do that.</p>
  
  <p>Thanks.</p>