IntentService和HandlerThread有什么区别? [英] What is difference between IntentService and HandlerThread?
本文介绍了IntentService和HandlerThread有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
它们都循环遍历队列(消息/意图)并执行它们?
They both loop through a queue of something (messages/intents) and execute them?
推荐答案
IntentService并没有真正遍历Intent队列,它使用 Service
接收Intent并在工作线程中对其进行处理,实际上,在 IntentService
中运行着一个 HandlerThread
来执行循环操作.
IntentService is not really loop through a queue of Intents, It uses the Service
to receive Intents and handle it in a worker thread, Actually, there is a HandlerThread
running in IntentService
doing the loop stuff.
这篇关于IntentService和HandlerThread有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文