【发布时间】:2013-05-16 06:33:54
【问题描述】:
即使我使用 Google play 服务示例中的 mapdemo 项目,Google 地图 API V2 仍显示空白屏幕
- 我重新安装了 google play 服务 SDK。
- 我更改了 API 密钥
- 我更改了 debug.keystore 并重新生成了 sha1 指纹
什么都没变……
而mMap 总是为空?
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();
}
【问题讨论】:
-
始终显示您尝试过的代码以及问题。其次,允许 Manifest.xml 中的 Internet 权限?
-
是的,我允许互联网 if (mMap == null) { // 尝试从 SupportMapFragment 获取地图。 mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); // 检查我们是否成功获取地图。 if (mMap != null) { setUpMap(); } mMap 总是 null 有什么原因?
-
请把你的xml文件,?
-
@jibran 我做了这些步骤
标签: android google-maps android-maps-v2