Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.app.Activity;
import android.content.Context;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;

public class Main {
    public static boolean isActivyFinish(Context context) {
        // TODO Auto-generated method stub
        if (context instanceof Activity) {
            Activity activity = (Activity) context;
            if (activity.isFinishing()) {
                return true;
            }
            if (VERSION.SDK_INT >= VERSION_CODES.KITKAT && activity.isDestroyed()) {
                return true;
            }
        }
        return false;
    }
}