Android/Nexus 7 为 Geocoder.getFromLocationName() 抛出 IOException

标签 android google-geocoder

我正在尝试使用 Geocoder.getFromLocationName(),尽管相同的搜索字符串在这些实际设备上工作正常:

  • 连结 1 (2.3.6)
  • 三星 Galaxy SIII (4.0.4)
  • 银河连结 (4.1.1)

在我的 Nexus 7 (4.1.1) 上,该方法抛出“服务不可用”IOException

这是简化的代码:

Geocoder geocoder = new Geocoder(mContext);
List<Address> addressFromSearch = geocoder.getFromLocationName("10918", 1);

我还尝试了每台使用移动数据和仅使用 wifi 的设备,它们都运行良好。到目前为止,唯一不工作的设备/操作系统是 Nexus 7。我还检查了 Geocoder.isPresent() - 它返回 true。

对我可能遗漏的东西有什么想法吗?

最佳答案

在 Galaxy Nexus 的 OTA 更新到 4.1.2 之后,这个问题终于解决了。这是一个关于 Android 版本 4.1.1 的错误

关于Android/Nexus 7 为 Geocoder.getFromLocationName() 抛出 IOException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12700077/

相关文章:

java - 如果没有 'retrolambda' 语法,我该如何编写?

android - 在 RelativeLayout 中按中心线对齐 View

Java Geocoding - 将纬度和经度转换为地址

android - 如何从地址中找到纬度和经度?

java - 如何访问 JSONObject 子字段?

Android缓存图像的最佳方式

android - Recycler 查看点击动画

javascript - 如何从 Google map API 函数中获取 javascript lat/lng 变量

java - Geocoder 并不总是返回一个值

安卓 notifyDataSetChanged