Java tutorial
//package com.java2s; import android.app.Activity; import java.util.Stack; public class Main { private static Stack<Activity> stack = new Stack<Activity>(); public static boolean isActivityExist(Class<?> cls) { for (Activity activity : stack) { if (activity.getClass().equals(cls)) { return true; } } return false; } }