Java tutorial
//package com.java2s; import android.app.Activity; import java.util.Deque; public class Main { private static Deque<Activity> sStack; private static void finishAllActivity() { for (Activity a : sStack) { if (a != null && !a.isFinishing()) { a.finish(); } } sStack.clear(); } }