android-Geocoder.getFromLocationName()在ICS设备中不起作用 [英] android - Geocoder.getFromLocationName() is not working in ICS device
问题描述
我有两个设备.一个是 HTC WildFire S ,另一个是 HTC 1V .我在应用程序中使用了Geocoder.getFromLocationName()
.它已在 HTC wildfire S 中成功运行.但是在 HTC 1V 中,出现以下错误.为什么它来了?我该如何解决?请任何人可以帮助我.
I have two devices. One is HTC WildFire S and other one is HTC 1V. I used the Geocoder.getFromLocationName()
in my application. It is running successfully in the HTC wildfire S. But in the HTC 1V i got the following error. why it's came? How can i solve this? please can anybody help me.
代码
Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault());
//s is the address
List<Address> addresses = geoCoder.getFromLocationName(s, 5); //Here i got the following Exception.
错误
06-18 16:28:17.933: W/System.err(4960): java.io.IOException: Service not Available
06-18 16:28:17.953: W/System.err(4960):at android.location.Geocoder.getFromLocationName(Geocoder.java:178)
位置标签
推荐答案
最后,我找到了答案: https://code.google.com/p/android/issues/detail?id=38009
Finally i found the answer :https://code.google.com/p/android/issues/detail?id=38009
重新启动设备,以使Geocoder正常工作.希望对别人有帮助
Reboot your device for Geocoder to work. Hope it helps someone
注意:有人说,如果您使用Google API 16,它将可以正常工作
Note: some say it will work if you use Google API 16
这篇关于android-Geocoder.getFromLocationName()在ICS设备中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!