Order of execution

suggest change

When first introduced, AsyncTasks were executed serially on a single background thread. Starting with DONUT, this was changed to a pool of threads allowing multiple tasks to operate in parallel. Starting with HONEYCOMB, tasks are executed on a single thread to avoid common application errors caused by parallel execution.

If you truly want parallel execution, you can invoke executeOnExecutor(java.util.concurrent.Executor, Object[]) with THREAD_POOL_EXECUTOR.

SERIAL_EXECUTOR -> An Executor that executes tasks one at a time in serial order.

THREAD_POOL_EXECUTOR -> An Executor that can be used to execute tasks in > parallel.

sample :

Task task = new Task();
    task.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, data);

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents