AsyncTask.executeOnExecutor() before API Level 11

If your build target is set to API Level 11 or higher, and you want to specifically use parallel tasks, you will want to start stating that explicitly in your code, akin to:

if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB) {
  myTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[]) null);
}
else {
  myTask.execute((Void) null);
}

http://commonsware.com/blog/2012/04/20/asynctask-threading-regression-confirmed.html

Leave a Comment