问题
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