问题
I am trying to reverse Geocode lat,long by this piece of code
Geocoder geocoder = new Geocoder(context, Locale.ENGLISH);
try {
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
return addresses;
} catch (IOException e) {
Log.e("Error : Geocoder", "Impossible to connect to Geocoder", e);
}
Its working on all devices except Huawei.It is giving exception in Huawei device. Client reported on his huawei device, Huawei Y625 running on kitkat. I tested it on huawei H30 running kitkat and its not working also. However running on all other devices tested inc Samsung, Nexus etc.
Any help would be appreciated.
回答1:
There is a problem with some android devices and the geocoder not working:
https://code.google.com/p/android/issues/detail?id=38009
A reboot seems to fix the issue.
回答2:
Most of the Huawei mobiles will not support GMS Map Services it will support HMS Map Services only .
回答3:
You should use HMS Site Kit's geocode function. You can find details on here:
HMS Site Kit Geocode
来源:https://stackoverflow.com/questions/38182203/android-reverse-geocoding-not-working-on-huawei-device