Article From:https://www.cnblogs.com/ganchuanpu/p/6607660.html

The key points that need to be known:
1.       Before 1.6, all AsyncTask was executed orderly in a single thread.
2.       From 1.6 to 2.3, these AsyncTask are executed in a thread pool, but there are upper limits.
3.       Start from 3, and use the earliest plan! They execute in a single thread, unless you call executeOnExecutor and import a ThreadPoolExecutor.
Resolvent:

publicclass ConcurrentAsyncTask {    
  public static void execute(AsyncTask as) {
         if (Build.VERSION.SDK_INT <Build.VERSION_CODES.HONEYCOMB) {
                as.execute();
         } else {
                as.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
         }
  }
}

  

Similar Posts:

Link of this Article: AsyncTask notes

Leave a Reply

Your email address will not be published. Required fields are marked *