【发布时间】:2011-06-25 06:57:47
【问题描述】:
我正在尝试从用户给定的地址中查找经纬度,因为我正在使用以下代码,
GeoPoint pointForEnterAddr;
try {
List<Address> address = coder.getFromLocationName(enterAddr, 1);
if (address == null)
pointForEnterAddr = null;
else {
Address location = address.get(0);
System.out.println("Lat in button click :"
+ location.getLatitude());
System.out.println("Long in button click :"
+ location.getLongitude());
pointForEnterAddr = new GeoPoint((int) (location.getLatitude() * 1E6),
(int) (location.getLongitude() * 1E6));
}
catch (Exception ex) {
System.out.println("Error here :" + ex);
}
但是每次它来捕获部分并显示异常时, java.io.IOException:服务不可用
我怎样才能解决它并获得正确的输出?请告诉我。
谢谢
【问题讨论】:
标签: android google-maps