AsyncTask API 翻譯

AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.java

AsyncTask 使操做UI線程更方便準確,這個類能夠執行後臺操做並在ui線程裏發佈結果,無需使用線程操做或handlers框架

AsyncTask is designed to be a helper class around Thread and Handler and does not constitute a generic threading framework. AsyncTasks should ideally be used for short operations (a few seconds at the most.) If you need to keep threads running for long periods of time, it is highly recommended you use the various APIs provided by the java.util.concurrent pacakge such as Executor, ThreadPoolExecutor and FutureTask.異步

AsyncTask 被設計成一個Thread和Handler的輔助類,並不是基於線程框架. AsyncTask 應該被用於短時操做,若是想保持線程長時間運行,強烈建議使用其餘API,好比Executor, ThreadPoolExecutor, FutureTaskasync

An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.ide

一個異步任務唄定義爲 ,運行在後臺線程,結果發佈在UI線程(主線程), 一個異步任務被定義爲3個參數, Params, Progress ,Result 4個步驟,onPreExecute(), doInBackground(), onProgressUpdate() ,onPostExecute()ui

相關文章
相關標籤/搜索