Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.annotation.TargetApi;
import android.os.AsyncTask;
import android.os.Build;

public class Main {
    public static <A, B, C> AsyncTask<A, B, C> execute(AsyncTask<A, B, C> task, A... args) {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ? executeHoneycomb(task, args)
                : task.execute(args);
    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    private static <A, B, C> AsyncTask<A, B, C> executeHoneycomb(AsyncTask<A, B, C> task, A... args) {
        return task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
    }
}