Here you can find the source of finishAll()
public static final void finishAll()
//package com.java2s; import java.util.ArrayList; import android.app.Activity; public class Main { private static ArrayList<Activity> actList = new ArrayList<Activity>(); public static final void finishAll() { for (int i = actList.size() - 1; i >= 0; i--) { actList.get(i).finish();//w w w. j a v a 2 s . com } actList.clear(); } }