Android注释中MainThread,UiThread,WorkerThread,BinderThread之间的区别

时间:2015-08-08 10:32:43

标签: android multithreading binding annotations android-support-library

正如我在thread document

的android注释中所读到的那样

我们有四种类型的线程,

  • @MainThread
  • @UiThread
  • @WorkerThread
  • @BinderThread

有什么区别?

1 个答案:

答案 0 :(得分:9)

区别在于:

  • @MainThread ,首次在应用启动时运行,
  • @UiThread ,从MainThread运行以获取用户界面的工作,
  • @WorkerThread ,在程序员定义线程时运行
  • @BinderThread ,用于ContentProvider中的query()/ insert()/ update()/ delete()方法。