Example usage for android.app Activity isFinishing

List of usage examples for android.app Activity isFinishing

Introduction

In this page you can find the example usage for android.app Activity isFinishing.

Prototype

public boolean isFinishing() 

Source Link

Document

Check to see whether this activity is in the process of finishing, either because you called #finish on it or someone else has requested that it finished.

Usage

From source file:Main.java

public static void finishAll() {
    for (Activity activity : activities) {
        if (!activity.isFinishing()) {
            activity.finish();/* w  w w  .ja  v a2  s.  co  m*/
        }
    }
}

From source file:Main.java

private static void finishAllActivity() {
    for (Activity a : sStack) {
        if (a != null && !a.isFinishing()) {
            a.finish();//from   www .  j  av a2s  .c  om
        }
    }
    sStack.clear();
}

From source file:Main.java

public static void showDialog(final Activity activity, AlertDialog dialog) {
    if (!activity.isFinishing()) {
        dialog.show();//ww  w  .j a va  2  s  .co m
    }
}

From source file:Main.java

public static void finishAll() {
    for (Activity activity : mActivities) {
        if (!activity.isFinishing()) {
            activity.finish();//from  ww  w . ja  v a 2  s.  co  m
        }
    }
    mActivities.clear();
}

From source file:Main.java

/**
 * Checks if a Context is not null and is not finishing and returns true, otherwise false.
 *//* w w w.j  a va2  s.  co  m*/
public static boolean isContextValid(Activity context) {

    if (context != null && !context.isFinishing()) {
        return true;
    }

    return false;
}

From source file:Main.java

public static boolean isActivyFinish(Context context) {
    // TODO Auto-generated method stub
    if (context instanceof Activity) {
        Activity activity = (Activity) context;
        if (activity.isFinishing()) {
            return true;
        }//ww w  .j  a  v  a  2  s . c  o  m
        if (VERSION.SDK_INT >= VERSION_CODES.KITKAT && activity.isDestroyed()) {
            return true;
        }
    }
    return false;
}

From source file:Main.java

public static boolean isActivityLive(Activity activity) {
    return activity != null && !activity.isDestroyed() && !activity.isFinishing();
}

From source file:Main.java

public static void finishAllActivity() {
    for (Activity activity : activityLists) {
        if (activity != null && !activity.isFinishing())
            activity.finish();/*from  ww w  . j a  va  2s  .com*/
    }
    System.exit(0);
}

From source file:Main.java

public static void finishAllActivity() {
    if (mActivityList.size() > 0) {
        Iterator<Activity> it = mActivityList.iterator();
        while (it.hasNext()) {
            Activity activity = it.next();
            if (!activity.isFinishing()) {
                activity.finish();/*w w w  .jav a2 s.  c  o  m*/
            }
        }
    }
}

From source file:Main.java

public static void finishAllActivity(Activity excludeActivity) {
    if (mActivityList.size() > 0) {
        if (excludeActivity != null) {
            mActivityList.remove(excludeActivity);
        }//from   w ww .  j  av  a2s. c om
        Iterator<Activity> it = mActivityList.iterator();
        while (it.hasNext()) {
            Activity activity = it.next();
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}