title: Cannot cast from Fragment to MapFragment
body: <p>I'm having problems with a Map Fragment. The error message is saying <em>Cannot cast from Fragment to MapFragment</em>. I tried changing to <code>extends FragmentActivity</code> together with <code>GoogleMap map = ((SupportMapFragment) getSupportFragmentManager()</code> but that caused problems with my <code>onCreateView</code> line of code instead.</p>
  
  <pre><code>import android.content.Context;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class Fragment01 extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      return inflater.inflate(R.layout.fragment_01, container, false);
  
      // Get a handle to the Map Fragment
      GoogleMap map = ((MapFragment) getFragmentManager()
              .findFragmentById(R.id.map)).getMap();
  
      LatLng sydney = new LatLng(-33.867, 151.206);
  
      map.setMyLocationEnabled(true);
      map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
  
      map.addMarker(new MarkerOptions()
              .title("Sydney")
              .snippet("The most populous city in Australia.")
              .position(sydney));
  }
  
  }
  </code></pre>