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 {
    public static boolean cancelTask(AsyncTask<?, ?, ?> paramAsyncTask) {
        if (!isAsynctaskFinished(paramAsyncTask))
            return paramAsyncTask.cancel(true);
        return false;
    }

    public static boolean isAsynctaskFinished(AsyncTask<?, ?, ?> paramAsyncTask) {
        return (paramAsyncTask == null) || (paramAsyncTask.getStatus() == AsyncTask.Status.FINISHED);
    }
}