Skip to content

Commit 6d9dcbc

Browse files
author
Dianne Hackborn
committed
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
1 parent 11d8481 commit 6d9dcbc

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

api/17.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ package android {
331331
field public static final int checkboxStyle = 16842860; // 0x101006c
332332
field public static final int checked = 16843014; // 0x1010106
333333
field public static final int checkedButton = 16843080; // 0x1010148
334+
field public static final int checkedTextViewStyle = 16843720; // 0x10103c8
334335
field public static final int childDivider = 16843025; // 0x1010111
335336
field public static final int childIndicator = 16843020; // 0x101010c
336337
field public static final int childIndicatorLeft = 16843023; // 0x101010f
@@ -1789,6 +1790,7 @@ package android {
17891790
field public static final int Widget_DeviceDefault_Button_Small = 16974146; // 0x1030142
17901791
field public static final int Widget_DeviceDefault_Button_Toggle = 16974148; // 0x1030144
17911792
field public static final int Widget_DeviceDefault_CalendarView = 16974190; // 0x103016e
1793+
field public static final int Widget_DeviceDefault_CheckedTextView = 16974299; // 0x10301db
17921794
field public static final int Widget_DeviceDefault_CompoundButton_CheckBox = 16974152; // 0x1030148
17931795
field public static final int Widget_DeviceDefault_CompoundButton_RadioButton = 16974169; // 0x1030159
17941796
field public static final int Widget_DeviceDefault_CompoundButton_Star = 16974173; // 0x103015d
@@ -1822,6 +1824,7 @@ package android {
18221824
field public static final int Widget_DeviceDefault_Light_Button_Small = 16974198; // 0x1030176
18231825
field public static final int Widget_DeviceDefault_Light_Button_Toggle = 16974200; // 0x1030178
18241826
field public static final int Widget_DeviceDefault_Light_CalendarView = 16974238; // 0x103019e
1827+
field public static final int Widget_DeviceDefault_Light_CheckedTextView = 16974300; // 0x10301dc
18251828
field public static final int Widget_DeviceDefault_Light_CompoundButton_CheckBox = 16974204; // 0x103017c
18261829
field public static final int Widget_DeviceDefault_Light_CompoundButton_RadioButton = 16974224; // 0x1030190
18271830
field public static final int Widget_DeviceDefault_Light_CompoundButton_Star = 16974228; // 0x1030194
@@ -1907,6 +1910,7 @@ package android {
19071910
field public static final int Widget_Holo_Button_Small = 16973964; // 0x103008c
19081911
field public static final int Widget_Holo_Button_Toggle = 16973966; // 0x103008e
19091912
field public static final int Widget_Holo_CalendarView = 16974060; // 0x10300ec
1913+
field public static final int Widget_Holo_CheckedTextView = 16974297; // 0x10301d9
19101914
field public static final int Widget_Holo_CompoundButton_CheckBox = 16973969; // 0x1030091
19111915
field public static final int Widget_Holo_CompoundButton_RadioButton = 16973986; // 0x10300a2
19121916
field public static final int Widget_Holo_CompoundButton_Star = 16973990; // 0x10300a6
@@ -1940,6 +1944,7 @@ package android {
19401944
field public static final int Widget_Holo_Light_Button_Small = 16974007; // 0x10300b7
19411945
field public static final int Widget_Holo_Light_Button_Toggle = 16974009; // 0x10300b9
19421946
field public static final int Widget_Holo_Light_CalendarView = 16974061; // 0x10300ed
1947+
field public static final int Widget_Holo_Light_CheckedTextView = 16974298; // 0x10301da
19431948
field public static final int Widget_Holo_Light_CompoundButton_CheckBox = 16974012; // 0x10300bc
19441949
field public static final int Widget_Holo_Light_CompoundButton_RadioButton = 16974032; // 0x10300d0
19451950
field public static final int Widget_Holo_Light_CompoundButton_Star = 16974036; // 0x10300d4
@@ -2673,6 +2678,7 @@ package android.app {
26732678
method public void invalidateOptionsMenu();
26742679
method public boolean isChangingConfigurations();
26752680
method public final boolean isChild();
2681+
method public boolean isDestroyed();
26762682
method public boolean isFinishing();
26772683
method public boolean isTaskRoot();
26782684
method public final deprecated android.database.Cursor managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
@@ -3480,6 +3486,7 @@ package android.app {
34803486
method public abstract int getBackStackEntryCount();
34813487
method public abstract android.app.Fragment getFragment(android.os.Bundle, java.lang.String);
34823488
method public void invalidateOptionsMenu();
3489+
method public abstract boolean isDestroyed();
34833490
method public abstract void popBackStack();
34843491
method public abstract void popBackStack(java.lang.String, int);
34853492
method public abstract void popBackStack(int, int);

api/current.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,7 @@ package android.app {
26782678
method public void invalidateOptionsMenu();
26792679
method public boolean isChangingConfigurations();
26802680
method public final boolean isChild();
2681+
method public boolean isDestroyed();
26812682
method public boolean isFinishing();
26822683
method public boolean isTaskRoot();
26832684
method public final deprecated android.database.Cursor managedQuery(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String);
@@ -3485,6 +3486,7 @@ package android.app {
34853486
method public abstract int getBackStackEntryCount();
34863487
method public abstract android.app.Fragment getFragment(android.os.Bundle, java.lang.String);
34873488
method public void invalidateOptionsMenu();
3489+
method public abstract boolean isDestroyed();
34883490
method public abstract void popBackStack();
34893491
method public abstract void popBackStack(java.lang.String, int);
34903492
method public abstract void popBackStack(int, int);

core/java/android/app/Activity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ private static class ManagedDialog {
685685
private boolean mStopped;
686686
boolean mFinished;
687687
boolean mStartedActivity;
688+
private boolean mDestroyed;
688689
/** true if the activity is going through a transient pause */
689690
/*package*/ boolean mTemporaryPause = false;
690691
/** true if the activity is being destroyed in order to recreate it with a new configuration */
@@ -4088,6 +4089,14 @@ public boolean isFinishing() {
40884089
return mFinished;
40894090
}
40904091

4092+
/**
4093+
* Returns true if the final {@link #onDestroy()} call has been made
4094+
* on the Activity, so this instance is now dead.
4095+
*/
4096+
public boolean isDestroyed() {
4097+
return mDestroyed;
4098+
}
4099+
40914100
/**
40924101
* Check to see whether this activity is in the process of being destroyed in order to be
40934102
* recreated with a new configuration. This is often used in
@@ -5258,6 +5267,7 @@ final void performStop() {
52585267
}
52595268

52605269
final void performDestroy() {
5270+
mDestroyed = true;
52615271
mWindow.destroy();
52625272
mFragments.dispatchDestroy();
52635273
onDestroy();

core/java/android/app/FragmentManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ public FragmentTransaction openTransaction() {
317317
*/
318318
public abstract Fragment.SavedState saveFragmentInstanceState(Fragment f);
319319

320+
/**
321+
* Returns true if the final {@link Activity#onDestroy() Activity.onDestroy()}
322+
* call has been made on the FragmentManager's Activity, so this instance is now dead.
323+
*/
324+
public abstract boolean isDestroyed();
325+
320326
/**
321327
* Print the FragmentManager's state into the given stream.
322328
*
@@ -587,6 +593,11 @@ public Fragment.SavedState saveFragmentInstanceState(Fragment fragment) {
587593
return null;
588594
}
589595

596+
@Override
597+
public boolean isDestroyed() {
598+
return mDestroyed;
599+
}
600+
590601
@Override
591602
public String toString() {
592603
StringBuilder sb = new StringBuilder(128);

0 commit comments

Comments
 (0)