我正在使用 Android Studio 1.1 和 AP1 21(课程需要的版本)。我使用Google Maps Activity
.
在自动生成的代码中,我收到以下错误消息:Error:(48, 21) error: cannot find symbol method getMap()
,在setUpMapIfNeeded
方法中:
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();
}
}
}
任何想法如何解决这个问题?谢谢!