Android中的UI线程和辅助线程之间的区别? [英] Difference between UI Thread and Worker Thread in Android?

查看:93
本文介绍了Android中的UI线程和辅助线程之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关Android上Thread的文档,但是找不到UI线程和Worker Thread之间的区别.有人可以给我更多的例子吗?

I have read documents about Thread on Android, but I could not find differences between UI thread and Worker Thread. Can someone just give me more example about it?

推荐答案

Ui线程是进行ui所需的任何更改的线程.

The Ui thread is the thread that makes any changes required for the ui.

工作者线程只是另一个线程,您可以在其中执行不想中断ui线程上发生的任何更改的处理

A worker thread is just another thread where you can do processing that you dont want to interupt any changes happening on the ui thread

如果在对ui进行更改时您正在ui线程上进行大量处理,则ui会冻结,直到您完成所有操作为止.

If you are doing large amounts of processing on the ui thread while a change to the ui is happening the ui will freeze until what ever you have running complete.

这篇关于Android中的UI线程和辅助线程之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆