实现Geocoder时返回null

问题描述

| 我正在尝试使用Geocoder查找地址(位置)。 我有以下代码:
double lat = (double) (coord.getLat() * (1e-6));
double lon = (double) (coord.getLon() * (1e-6));
try { 
    List<Address> list = geocoder.getFromLocation(lat,lon,1);

    if (list != null && list.size() > 0) {
        Address address = list.get(0);
        result = address.getAddressLine(0) + \",\"
            + address.getLocality();
    }
System.out.println(\"adresa returnata folosind geocoder:\"
                + result);
}
我传递给地址解析器的数据采用以下格式: 2.449548 48.950518 但是,当尝试将Geocoder返回的第一个地址设为“ 1”时,它将返回null。这是我的logcat的样子:   reverseGeocode()`:无功能   位置 我的
System.out.println()
显示
:null
。我的清单文件中添加了互联网访问权限和互联网权限。有人知道我在做什么错吗?     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)