Google Maps Android Api: Supportmapfragment Vs Mapfragment
Solution 1:
Then I assume that SupportMapFragment targets API 11 and below, though google didn't explicit mention it in the documentation.
SupportMapFragment
is for use with the Android Support package's backport of fragments. It can be used on Android devices running API 10 and lower, as well as Android devices running 11 and higher. MapFragment
requires the native API Level 11 fragment implementation, and therefore can only be used on API Level 11 and higher devices.
Note that there are no devices running API Level 11 that I know of -- everything has been upgraded at least to API Level 12.
Solution 2:
One nevertheless is forced to use SupportMapFragment
in general, because it can be cast:
SupportMapFragmentmapFragment= (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
if (mapFragment != null) {mapFragment.getMapAsync(this);}
For some reason FragmentManager
cannot return MapFragment
, despite it is generally known.
Post a Comment for "Google Maps Android Api: Supportmapfragment Vs Mapfragment"