FileDocCategorySizeDatePackage
AsyncTaskCompat.javaAPI DocAndroid 5.1 API1873Thu Mar 12 22:22:56 GMT 2015android.support.v4.os

AsyncTaskCompat

public class AsyncTaskCompat extends Object
Helper for accessing features in {@link android.os.AsyncTask} introduced after API level 4 in a backwards compatible fashion.

Fields Summary
Constructors Summary
Methods Summary
public static android.os.AsyncTaskexecuteParallel(android.os.AsyncTask task, Params params)
Executes the task with the specified parameters, allowing multiple tasks to run in parallel on a pool of threads managed by {@link android.os.AsyncTask}.

param
task The {@link android.os.AsyncTask} to execute.
param
params The parameters of the task.
return
the instance of AsyncTask.

        if (task == null) {
            throw new IllegalArgumentException("task can not be null");
        }

        if (Build.VERSION.SDK_INT >= 11) {
            // From API 11 onwards, we need to manually select the THREAD_POOL_EXECUTOR
            AsyncTaskCompatHoneycomb.executeParallel(task, params);
        } else {
            // Before API 11, all tasks were run in parallel
            task.execute(params);
        }

        return task;