Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;

import java.util.Stack;

public class Main {
    private static Stack<Activity> activityStack;

    public static boolean hasActivity(Class<?> clz) {
        if (null != clz) {
            if (null != activityStack && activityStack.size() > 0) {
                for (int i = 0; i < activityStack.size(); i++) {
                    if (activityStack.get(i).getClass().getName().contains(clz.getName())) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
}