diff options
| author | Alan Viverette <alanv@google.com> | 2013-08-14 22:55:55 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-14 22:55:55 +0000 |
| commit | 5482ab01e37accb4f5559af80f8d5d6e92b353ff (patch) | |
| tree | a325dbf3191e228ab9a6db987cacc998f8ec68d5 /core/java/android | |
| parent | 12285f3d9f756226c13ef93054b87e0d487e1409 (diff) | |
| parent | 95a4609b90abe02474c815c216780a1383f13cb2 (diff) | |
Merge "Throw exception in FragmentManager when queuing to a destroyed activity" into klp-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/FragmentManager.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index 7358f735ae36..a7789d6c0b70 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -1328,12 +1328,19 @@ final class FragmentManagerImpl extends FragmentManager { } } + /** + * Adds an action to the queue of pending actions. + * + * @param action the action to add + * @param allowStateLoss whether to allow loss of state information + * @throws IllegalStateException if the activity has been destroyed + */ public void enqueueAction(Runnable action, boolean allowStateLoss) { if (!allowStateLoss) { checkStateLoss(); } synchronized (this) { - if (mActivity == null) { + if (mDestroyed || mActivity == null) { throw new IllegalStateException("Activity has been destroyed"); } if (mPendingActions == null) { |
