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