Google Maps Fragment returning null inside a fragment

I have solved the issue.
this line when I have a viewpager:

mMap = ((SupportMapFragment) MainActivity.fragmentManager
                .findFragmentById(R.id.mapView)).getMap();

you have to change to this:

  mMap = ((SupportMapFragment) getChildFragmentManager()
            .findFragmentById(R.id.mapView)).getMap();

Leave a Comment