Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import android.app.Activity;

public class Main {
    public static ArrayList<Activity> arrayList = new ArrayList<Activity>();

    public static void finishOtherZctivity(Activity activity) {
        Activity act = null;
        int length = arrayList.size() - 1;
        for (int i = length; i >= 0; i--) {
            act = arrayList.get(i);
            if (act != null && act == activity) {
                act.finish();
                arrayList.remove(i);
            }
        }
    }
}