BlackBerry 中未调用 locationUpdated
我试图实现 LocationListener 然后使用 locationUpdated,但即使我每 10 秒设置一次间隔,似乎 locationUpdated 也没有被调用。
Criteria myCriteria = new Criteria();
myCriteria.setCostAllowed(false);
LocationProvider provider = LocationProvider.getInstance(myCriteria);
provider.setLocationListener(new LocationHandler(), 10, -1, -1);
im trying to to implement LocationListener and then use locationUpdated, but even after i setup the intervel for it every 10 sec, it seems that locationUpdated is not being called.
Criteria myCriteria = new Criteria();
myCriteria.setCostAllowed(false);
LocationProvider provider = LocationProvider.getInstance(myCriteria);
provider.setLocationListener(new LocationHandler(), 10, -1, -1);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首次获取提供程序后,最好在设置位置侦听器之前重置它:
此外,如果您使用 BrowserField,请注意该字段将注册自己的侦听器,从而覆盖您的侦听器(已知错误)。唯一的解决方法是通过 getLocation() 自行轮询位置。
After you first get the provider, it's always a good idea to reset it before setting your location listener:
Also, if you are using a BrowserField be aware that the field will register its own listener, overriding yours (a known bug). The only workaround for that is to poll the location yourself via getLocation().