0

I have this error: "cannot find symbol method getMap()" please help me to solve it,i use the initilizeMap() function to load map. If map is not created it will create it for you

    private void initilizeMap() {
            if (googleMap == null) {
                googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                        R.id.ma`enter code here`p)).getMap();



                googleMap.setMyLocationEnabled(true);

                LatLng latLng = new LatLng(gps.getLatitude(), gps.getLongitude());
                CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 14);
                googleMap.animateCamera(cameraUpdate);

                //googleMap.setOnMarkerClickListener(this);
                // check if map is created successfully or not
                if (googleMap == null) {
                    Toast.makeText(getApplicationContext(),
                            "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                            .show();
                }
            }
        }

0 Answers0