Java tutorial
//package com.java2s; import android.app.Activity; import java.util.Stack; public class Main { private static Stack<Activity> mActivityStack; public static void addActivity(Activity activity) { if (null == mActivityStack) { mActivityStack = new Stack<>(); } mActivityStack.add(activity); } }