简体   繁体   English

如果退出正在处理的循环程序,处理程序将如何处理?

[英]What will happen to a handler if the looper it is handling is quit?

I have a thread handler which handles the looper of a "worker" thread. 我有一个线程处理程序,用于处理“工人”线程的弯针。 At some point in my Activity's lifecycle, I am calling "quit" method on the worker thread which releases its current looper. 在我的Activity生命周期的某个时刻,我正在工作线程上调用“ quit”方法,以释放其当前循环程序。 Then what will happen to the (worker) thread handler? 那么(工作者)线程处理程序将发生什么?

一旦您在looper上调用quit,它将丢弃que中的所有消息,并且不再接收其他消息。

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

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