summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Activity.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-10-02 17:51:13 -0700
committerDianne Hackborn <hackbod@google.com>2012-10-02 17:51:13 -0700
commit6d9dcbccec126d9b87ab6587e686e28b87e5a04d (patch)
tree9d75b09e6b1e582b2bf290e65fbf39c8b5b98b45 /core/java/android/app/Activity.java
parent11d8481f10a12caef0cfd9be7fe86e61d953d58f (diff)
downloadframeworks_base-6d9dcbccec126d9b87ab6587e686e28b87e5a04d.zip
frameworks_base-6d9dcbccec126d9b87ab6587e686e28b87e5a04d.tar.gz
frameworks_base-6d9dcbccec126d9b87ab6587e686e28b87e5a04d.tar.bz2
Fix issue #7273573: Need API to find out if activity is destroyed
Also update 17.txt with all of the recent API additions. Change-Id: I21fc669267935261a741c19e22b0bf35c3a76b81
Diffstat (limited to 'core/java/android/app/Activity.java')
-rw-r--r--core/java/android/app/Activity.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 7606d5e..5dc9da2 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -685,6 +685,7 @@ public class Activity extends ContextThemeWrapper
private boolean mStopped;
boolean mFinished;
boolean mStartedActivity;
+ private boolean mDestroyed;
/** true if the activity is going through a transient pause */
/*package*/ boolean mTemporaryPause = false;
/** true if the activity is being destroyed in order to recreate it with a new configuration */
@@ -4089,6 +4090,14 @@ public class Activity extends ContextThemeWrapper
}
/**
+ * Returns true if the final {@link #onDestroy()} call has been made
+ * on the Activity, so this instance is now dead.
+ */
+ public boolean isDestroyed() {
+ return mDestroyed;
+ }
+
+ /**
* Check to see whether this activity is in the process of being destroyed in order to be
* recreated with a new configuration. This is often used in
* {@link #onStop} to determine whether the state needs to be cleaned up or will be passed
@@ -5258,6 +5267,7 @@ public class Activity extends ContextThemeWrapper
}
final void performDestroy() {
+ mDestroyed = true;
mWindow.destroy();
mFragments.dispatchDestroy();
onDestroy();