【发布时间】:2016-08-22 18:33:04
【问题描述】:
我使用的是 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();
}
}
}
任何想法如何解决这个问题?谢谢!
【问题讨论】:
标签: android-studio google-maps-android-api-1