正如我在thread document
的android注释中所读到的那样
我们有四种类型的线程,
- 的 @MainThread
- 的 @UiThread
- 的 @WorkerThread
- @BinderThread
有什么区别?
1 个答案:
答案 0 :(得分:9)
区别在于:
- @MainThread ,首次在应用启动时运行,
- @UiThread ,从MainThread运行以获取用户界面的工作,
- @WorkerThread ,在程序员定义线程时运行
- @BinderThread ,用于ContentProvider中的query()/ insert()/ update()/ delete()方法。