Does the geocoder work on emulators

岁酱吖の 提交于 2019-12-01 20:45:00
Yaroslav Mytkalyk

There is no Geocoder installed on emulators. Accroding to Geocoder reference

The Geocoder class requires a backend service that is not included in the core android framework. The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists.

You should have checked

Geocoder.isPresent()

Before accessing the API. It's more reliable to use your own implementation. Check this answer for my implementation. problems with android.location.geocoder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!