【发布时间】:2014-05-06 16:24:16
【问题描述】:
我正在尝试使用 Fused Location API 在我的应用中获取位置。
我所做的是调用 LocationClient.connect(),然后在 onConnected 方法中查找位置。
我没想到的是:
IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.
但我在 onConnected 方法中! O_o
即使我在那里,我显然也完全没有连接到服务!那我该怎么办?
这是引发错误的代码:
Geocoder geoCoder = new Geocoder(this.getActivity(), Locale.getDefault());
String locationCity = "";
try {
Location loc = locationclient.getLastLocation();
...
【问题讨论】:
标签: android google-maps google-play-services android-location location-client