Java tutorial
//package com.java2s; import android.app.Activity; import java.util.ArrayList; public class Main { private static ArrayList<Activity> activityList; public static void removeActivity(Activity activity) { if ((activityList != null) && (activity != null)) { activity.finish(); activityList.remove(activity); activity = null; } } }