我知道这个问题以前经常被问到,但我无法从任何答案或搜索结果中得到解决方案。我必须尽快解决这个问题。我试图从用户输入的地址中获取纬度和经度,但我继续得到:
java.io.IOException: Unable to parse response from server
我正在使用这段代码:
Geocoder geocoder = new Geocoder(this ,Locale.getDefault());
String newAddress = (String)saveas.getText().toString();
List<Address> addresses = geocoder.getFromLocationName(newAddress, 1);
我尝试了很多不同的可能方法,但没有任何效果......默认地图应用程序运行良好,当用户输入地址时,它成功地在地图中显示该地址......我该怎么做......?
我已经添加了所有必需的权限,我正在真实设备(2.3 版)上对其进行测试...