Map Activity doesn\'t showing map, it\'s appear as just white screen with zoom control buttons. Manifest File like this :
I got this problem using MapView
fragment_map.xml
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
String message = getArguments().getString(EXTRA_MESSAGE);
v = inflater.inflate(R.layout.map_f, container, false);
vh = new ViewHolder();
assetHandler = new AssetHandler(getActivity());
vh.mapView=assetHandler.mapViewHandler.set(v,R.id.mapview);
vh.mapView.onCreate(savedInstanceState);
vh.mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.setMyLocationEnabled(true);
// Needs to call MapsInitializer before doing any CameraUpdateFactory calls
try {
MapsInitializer.initialize(getActivity());
} catch (Exception e) {
e.printStackTrace();
}
}
});
return v;
}
@Override
public void onResume() {
super.onResume();
vh.mapView.onResume();
}
@Override
public void onPause() {
vh.mapView.onPause();
super.onPause();
}
@Override
public void onDestroy() {
vh.mapView.onDestroy();
super.onDestroy();
}
@Override
public void onLowMemory() {
super.onLowMemory();
vh.mapView.onLowMemory();
}
I noticed if the LifeCycle methods are not implemented, you will not be able to see the map as well. hope this is hopeful for some.