I'm using Android Studio 1.1, and AP1 21 (version required as part of a course). I create a new project using the Google Maps Activity
.
Within the automatically generated code, I get the following error message: Error:(48, 21) error: cannot find symbol method getMap()
, in the setUpMapIfNeeded
method:
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
Any ideas how to fix this problem? Thanks!