I need your help... I work on it until 3 days. My app is working with fragments. One of these fragments has to display a map from the Google Maps V2 api for Android.
Use SupportMapFragment to overcome this error:
In fragment layout
In Your Fragment onCreateView
SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.googleMap);
if (mapFragment != null) {
mapFragment.getMapAsync(this);
}
Since your layout is in the Fragment's layout, therefore the SupportMapFragment is the child layout of your fragment. Hence use getChildFragmentManager() which is Fragment's FragmentManager