Java tutorial
//package com.java2s; import android.app.Activity; import java.util.Stack; public class Main { private static Stack<Activity> mActivityStack; public static void removeAllActivity() { if (mActivityStack != null && mActivityStack.size() > 0) { for (Activity activity : mActivityStack) { activity.finish(); } } } }