MapFragment or MapView getMap() returns null on Lollipop

前端 未结 4 1695
情话喂你
情话喂你 2020-12-09 09:32

I\'ve been using Google Maps API v2 for a long time on Android 4.x versions without a problem. Now I installed latest Lollipop build on my Nexus devices (5 and 7) trying to

4条回答
  •  孤城傲影
    2020-12-09 10:08

    Google now made a more convenient way to get the map using the following method

        myMapFragment.getMapAsync(new OnMapReadyCallback) {
             @Override
             public void onMapReady(GoogleMap googleMap) {
                 myMap = googleMap;
             }
        });
    

提交回复
热议问题