location - android - how to limit a proccess by time -


i'm trying search user's location, problem want limit time search time. is, if enough location not found after ten seconds or so, return best location found until time.

i have asynctask activates location listener. i'm trying limit time android.os.process.getelapsedcputime() works when location location listener has arrived after time set.

what want keep running time passed, regaredless of location listener. how can so?

why cant u run timer (java.util.timer) can create timertask. start both asynctask , timer @ time scheduling interval of 10 seconds. after 10 seconds check status of asynctask. if still in running or pending state cancel asynctask. think helpful you.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -