android中asynctask和thread之间的主要区别是什么?

时间:2014-03-05 09:52:38

标签: android android-asynctask

你能告诉我:

  1. asynctask和thread之间的主要区别是,简而言之一行?
  2. Asynctask和Thread各自的优点和缺点是什么?

1 个答案:

答案 0 :(得分:2)

主题

1. A Thread is a Thread, probably you already know it from other part. You need to know that you cannot   update UI from a Thread. You need to use a Handler for this, but read further.

AsyncTask

2.  An AsyncTask is an intelligent Thread that is advised to be used. Intelligent as it can help with it's methods, and there are two methods that run on UI thread, which is good to update UI components.