Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.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
当前位置按钮在google map API android中未移动_Android_Google Maps - Fatal编程技术网

当前位置按钮在google map API android中未移动

当前位置按钮在google map API android中未移动,android,google-maps,Android,Google Maps,我在应用程序中添加了以下代码: theMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() { @Override public void onMapLoaded() { LatLngBounds bounds = builder.build(); Log.e("bounds ", bounds.southwest.toString()+" "

我在应用程序中添加了以下代码:

theMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {

        @Override
        public void onMapLoaded() {
            LatLngBounds bounds = builder.build();
            Log.e("bounds ", bounds.southwest.toString()+" "+bounds.northeast.toString());
            theMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
        }
    });
之后,“移动到当前”按钮将不起作用。
谢谢

我发现卸载并重新构建它可以正常工作。
很抱歉提出这个问题。

您是否尝试过
getmapsync(OnMapReadyCallback)
?如果您有最新的Google Play服务版本,则可以使用此异步方法