Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.AsyncTask;

public class Main {
    /**
     * Cancels asynchronous tasks immediately.
     * @param tasks array of asynchronous tasks
     */
    public static void cancelTasks(AsyncTask<?, ?, ?>... tasks) {
        if (null != tasks) {
            for (AsyncTask<?, ?, ?> task : tasks) {
                if (null != task)
                    task.cancel(true);
            }
        }
    }
}