简体   繁体   English

我应该使用Timer,Handler还是ASyncTask?

[英]Should I use a Timer, Handler or ASyncTask?

I have a thread which needs to be run in the background every 1000ms. 我有一个线程,需要每1000毫秒在后台运行一次。 It can't be run in the UI as it freezes the app. 它会冻结应用程序,因此无法在UI中运行。 What method should I be using to do this action? 我应该使用哪种方法来执行此操作?

TimerTask似乎非常适合我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM