We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您可以使用地理编码器从纬度/经度返回地址,如下所示。
您应该知道 Geocoder 并不总是返回结果,它可能需要几次尝试,这就是为什么它用 try catch 包装的原因。这样您就可以使用 IO 异常消息写入 Toast 或 Logcat。
此外,当您像我一样在 Geocoder 构造函数中传递区域设置时,您将获得最佳结果。
you can use Geocoder to return addresses from lat/lon like this.
You should know that Geocoder will not always return with a result, it may take a few tries thats why it's wrapped with a try catch. This way you can write to Toast or Logcat with the IO exception msg.
Also you will get the best results when you pass it a locale in the Geocoder constructor as I am doing.
请参阅 Geocoder.getFromLocation
See Geocoder.getFromLocation