GLS 失败,状态为 20 -Android 获取用户位置
locationManager = (LocationManager)context.getSystemService(context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER);
Geocoder geocoder = new Geocoder(context);
List <Address> myLocation = null;
try {
myLocation = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(), 1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
日志如下:
LocationMasfClient: reverseGeocode(): GLS failed with status 20
我找不到原因。
locationManager = (LocationManager)context.getSystemService(context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation(locationManager.NETWORK_PROVIDER);
Geocoder geocoder = new Geocoder(context);
List <Address> myLocation = null;
try {
myLocation = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(), 1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The log is below:
LocationMasfClient: reverseGeocode(): GLS failed with status 20
I can not find the reason.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅帮助!地理编码失败:forwardGeocode(): 如果您使用 API v8,GLS 失败,状态为 20
通常,GLS 在我的应用程序中第二次尝试时可以工作...
See Help! Geocoding fails: forwardGeocode(): GLS failed with status 20 if u use API v8
Often GLS works on the second try in my app...