Java tutorial
//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; } }