Java tutorial
//package com.java2s; import android.app.Activity; import java.util.Stack; public class Main { private static Stack<Activity> statckActivity; public static Activity getActivity(Class<?> activityClass) { if (statckActivity != null) { for (Activity activity : statckActivity) { if (activity.getClass().equals(activityClass)) { return activity; } } } return null; } }