【发布时间】:2018-10-05 09:18:48
【问题描述】:
现在我正在尝试获取位置的国家/地区名称,但我无法在 getFromLocation() 中传递 LatLng。
我该如何解决这个问题?
public void checkCountry(LatLng location) {
Geocoder gcd = new Geocoder(this, Locale.getDefaut());
List<Address> addresses = gcd.getFromLocation(location.latitude, location.logtitude, 1); //error here
String country = addresses.get(0).getCountryName();
错误提示
未处理的异常:java.IO.Exception
getFromLocation() 不能应用于: 纬度双位置.纬度 longtitude double location.longtitude
我有什么问题?
【问题讨论】:
标签: java android google-maps google-geocoder