Java tutorial
//package com.java2s; //License from project: Open Source License import android.annotation.SuppressLint; import android.os.AsyncTask; import android.os.Build; public class Main { @SuppressLint("InlinedApi") public static void execute(AsyncTask<Void, ?, ?> asyncTask) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR1) { asyncTask.execute(); } else { asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } }