Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android getMap()使用play services 7.3返回空查找映射(使用play services 7.0返回ok)_Android_Google Maps - Fatal编程技术网

Android getMap()使用play services 7.3返回空查找映射(使用play services 7.0返回ok)

Android getMap()使用play services 7.3返回空查找映射(使用play services 7.0返回ok),android,google-maps,Android,Google Maps,Android getMap()在一部手机中使用play services 7.3时返回null(在play services 7.0和其他手机中返回ok) 电话 fonepad 6。安卓版本4.2.2 google play服务版本: compile 'com.google.android.gms:play-services:7.3.0' compile 'com.google.android.gms:play-services:7.0.0' XML: mMap在fonepad中返回nul

Android getMap()在一部手机中使用play services 7.3时返回null(在play services 7.0和其他手机中返回ok)

电话

fonepad 6。安卓版本4.2.2

google play服务版本:

compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.android.gms:play-services:7.0.0'
XML:

mMap在fonepad中返回null。在另外两个手机测试和模拟器它的工作正常

使用play services版本:

compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.android.gms:play-services:7.0.0'
它在所有测试过的手机上都能正常工作,包括fonepad

知道发生了什么吗? 这可能是play services 7.3.0的一个bug吗? 我找不到任何解释。

已被弃用,并且已经有一段时间了:

此方法已弃用

改为使用getMapAsync(OnMapReadyCallback)。回调方法为您提供一个保证为非null且随时可用的GoogleMap实例

改为使用getMapAsync(OnMapReadyCallback):

getMapAsync(new OnMapReadyCallback() {
    public void onMapReady(GoogleMap googleMap) {
        // ...
    }
});

结果很好。当我使用这种方法时,手机已经更新了google play服务,但他之前没有,当我使用不推荐的方法时。非常感谢,它成功了。那就接受我的回答吧;)