in Xamarin android, creating MapFragment, the code shows map, but mapFragment.Map is always null and I can't set map type
code:
var mapFragment = MapFragment.NewInstance (mapOptions);
FragmentTransaction tx = FragmentManager.BeginTransaction();
tx.Add(Resource.Id.map_fragment_container, mapFragment);
map = mapFragment.Map;
if (map != null) {
map.MapType = GoogleMap.MapTypeNormal;//never comes to this line
}
tx.Commit();
xml:
<FrameLayout
android:id="@+id/map_fragment_container"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent" />