Hello I'm trying to add MapView to LinearLayout this is my code:
GoogleMap mMap = mMapView.getMap();
if (mMap != null) {
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(-33.87365, 151.20689), 10);
if (cameraUpdate != null)
mMap.moveCamera(cameraUpdate);
setUpMap(mMap);
}
documantation says; Wait for a GoogleMap
to become available from a MapFragment
or MapView
that you have added to your application. You can verify that the GoogleMap
is available by calling the getMap()
method and checking that the returned object is not null.
But i still get
java.lang.NullPointerException: CameraUpdateFactory is not initialized.
is there any way to check cameraUpdateFactory is ready?