title: MapFragment.getMap( ) always returns null
body: <p><code>mMapFragment.getMap()</code> always returns null. I am supported from api level 12 onwards, so I am using <code>MapFragment</code> instead of <code>SupportMapFragment</code>.</p>
  
  <pre><code>public class MFragment extends Fragment {
  
  private static final String MAP_FRAGMENT_TAG = "map";
  private GoogleMap mMap;
  private MapFragment mMapFragment;
  FragmentManager fm;
  Context con;
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
      fm = getFragmentManager();
      con = getActivity();
        // It isn't possible to set a fragment's id programmatically so we set a tag instead and
      // search for it using that.
      mMapFragment = (MapFragment) getFragmentManager()
              .findFragmentByTag(MAP_FRAGMENT_TAG);
  
      // We only create a fragment if it doesn't already exist.
      if (mMapFragment == null) {
          // To programmatically add the map, we first create a SupportMapFragment.
          mMapFragment = MapFragment.newInstance();
  
          // Then we add it using a FragmentTransaction.
          FragmentTransaction fragmentTransaction =
                 fm.beginTransaction();
          fragmentTransaction.add((R.id.mapframelayout, mMapFragment);  
          fragmentTransaction.commit();
      }
  
      // We can't be guaranteed that the map is available because Google Play services might
      // not be available.
      setUpMapIfNeeded();
  }
  
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      View v = inflater.inflate(R.layout.dynamic, container, false);
      return v;
  }
  
  
  
  private void setUpMapIfNeeded() {
      // Do a null check to confirm that we have not already instantiated the map.
      if (mMap == null) {
          // Try to obtain the map from the SupportMapFragment.
          mMap = mMapFragment.getMap();
          // Check if we were successful in obtaining the map.
          if (mMap != null) {
              setUpMap();
          }
      }
  }
  
  private void setUpMap() {
      mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Can any one tell why it always returns null?
  Thanks in advance.</p>