在安卓GPS超时 [英] GPS timeout in android

查看:587
本文介绍了在安卓GPS超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在黑莓中,我们使用超时拿到的位置,因此,如果它不在于多的时间内retun位置,我们结识。但在Android中,有超时的概念,任何人都可以请告诉替代方案,我们可以发现,经过这么多时间没有来自GPS没有位置更新。

In blackberry, we use a timeout to get the location, so that if it doesnt retun location in that much time period, we get to know. But in Android, there is no concept of timeout, can anyone please tell the alternative, that we can find out that after this much time there is no location update from GPS.

推荐答案

您可以使用两个线程超时。一个线程尝试获取GPS定位和其他(超时)线,一旦达到指定的超时时间,将删除你的应用程序的注册从位置监听器接收位置更新。

You can use two threads for this timeout. One thread tries to get the GPS fix and the other (timeout) thread, once it reaches the timeout specified, removes the registration of your application to receive location updates from the location listener.

这篇关于在安卓GPS超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆