Geocoder.getFromLocation throws Exception [duplicate]
Possible Duplicate:
Geocoder.getFromLocation throws IOException on Android emulator
I 开发者_Python百科am using Google api 7, Android2.1 emulator
I am trying to do reverse geocoding and I get:
03-07 16:19:42.661: WARN/System.err(261): java.io.IOException: Unable to parse response from server
on that line:
List<Address> addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
any idea?
thanks, ray.
Do note that when you call that method, it fires off an API call to Google Maps' servers - it isn't doing it on the device. I suspect this is an error you will see sometimes, because the method is not managing to get a meaningful response from the Google Maps API. I've used this method and I occasionally see that error, but I usually put the method into a loop of 10 retries, and quietly ignore the occasional error. If it's happening every time you call the method, there's something odd happening
精彩评论