开发者

Performing Wifi scanning at regular interval, using AsyncTask/Handler in android

开发者 https://www.devze.com 2023-04-10 12:02 出处:网络
I wish to perform Wifi scanning at regular interval between 0-10sec as the time can be set by user. However, i am not sure whether to use AsyncTask or Handler to do so or even combining both to achiev

I wish to perform Wifi scanning at regular interval between 0-10sec as the time can be set by user. However, i am not sure whether to use AsyncTask or Handler to do so or even combining both to achieved the task. And also, while the timer is running, user might change the time and so the program would have to change 开发者_C百科accordingly.


The TimerTask already runs on it's own thread, so you don't need to use an AsyncTask just put the code you want to run in the TimerTask.run() method.

All The Best

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号