GPS timeout in android

扶醉桌前 提交于 2019-12-08 02:15:25

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/2589811/gps-timeout-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!