in my following code, getMap() returns null, which stop the app. If I don't do anything with the map (i.e, removing the last two lines), it shows correctly. Any idea why? Thanks.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
FragmentManager fragmentManager = getSupportFragmentManager();
SupportMapFragment mapFragment = SupportMapFragment.newInstance();
mapFragmentId = mapFragment.getId();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.add(R.id.my_container, mapFragment);
transaction.commit();
mMap = mapFragment.getMap();
mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
}