开发者

Geocoder class is not working properly in android

开发者 https://www.devze.com 2022-12-20 12:13 出处:网络
My application I\'m using Geocoder class for retrieve the location latitude and longtude My code is : addr开发者_StackOverflowessInput = street+","+city+","+pin+","+count

My application I'm using Geocoder class for retrieve the location latitude and longtude

My code is :

addr开发者_StackOverflowessInput = street+","+city+","+pin+","+country; 
List<Address> foundAdresses = gc.getFromLocationName(addressInput, 5);
 

First time it is throwing exception like this

java.io.IOException:Unable to parse response from server

ERROR/ProtoRequestListener(566): com.google.common.async.WatchdogException

Plese resolve it and if you have any code retrieve the location latitude and longitude send me


This should solve your problem.

List<Address> addresses = 
          new Geocoder(this,Locale.getDefault()).getFromLocation(lat, lon, 1);
0

精彩评论

暂无评论...
验证码 换一张
取 消