onLocationChanged()没有调用Android设备上 [英] onLocationChanged() not called on Android device
问题描述
我在使用谷歌地图API在Android上一些trobule。
在onLocationChanged()创建一个覆盖并将其添加到的MapView,其中采用Android 2.1在模拟器上工作正常,但是当我尝试在设备上进行调试,没有任何反应。可能是什么问题?
I have some trobule using Google Maps API on Android. In onLocationChanged() I create an overlay and add it to the MapView, which works fine on the emulator using Android 2.1, but when I try to debug on a device, nothing happens. What could be the problem?
该设备是索尼爱立信Xperia Arc采用Android 2.3。
The device is Sony Ericsson Xperia Arc with Android 2.3.
谢谢你,伊万。
推荐答案
实际设备并不总能得到GPS信号,尤其是在室内。我猜你应该使用 NetworkProvider
在你的听众,如果GPS不可用。
Real devices does not always get GPS signals, especially indoors. I guess you should use NetworkProvider
in your listener if GPS is not available.
这是一个很好的参考
http://android-developers.blogspot.com/2011 /06/deep-dive-into-location.html
这篇关于onLocationChanged()没有调用Android设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!