diff options
| author | Chet Haase <chet@google.com> | 2012-04-19 13:39:50 -0700 |
|---|---|---|
| committer | Chet Haase <chet@google.com> | 2012-04-19 13:39:50 -0700 |
| commit | b78c284bd535f48207750e5a406474ea22381edd (patch) | |
| tree | dd05f5bdae2690d5b601506d8e0e8b1bfaa186f2 | |
| parent | 5b086eb5438b5048bd3fbf4e2ed9390ec10245b3 (diff) | |
| download | frameworks_base-b78c284bd535f48207750e5a406474ea22381edd.zip frameworks_base-b78c284bd535f48207750e5a406474ea22381edd.tar.gz frameworks_base-b78c284bd535f48207750e5a406474ea22381edd.tar.bz2 | |
Always execute actions on the runQueue
A View that is not attached will place posted actions on the
ViewRoot's runQueue. Previously, this runQueue was only ever executed
during a layout (during performTraversals()). This works in most situations
(a View that is added to or removed from the hierarchy will force a layout
in general), but not in all cases. For example, a new View being added to
a ListView will not cause a layout, so any actions posted to that View
prior to its being attached will not be run until some indeterminate time
later when a layout happens to run.
The fix is to execute the (typically empty) runQueue on every traversal.
Issue #6366678 View.post() ignored when called on an unattached ListView item
Change-Id: I94e6fdd9da6bb57fd83b547f8d742cd0ddfecbd6
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 3d40b2f..247f673 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1199,13 +1199,13 @@ public final class ViewRootImpl implements ViewParent, } } + // Execute enqueued actions on every traversal in case a detached view enqueued an action + getRunQueue().executeActions(attachInfo.mHandler); + boolean insetsChanged = false; boolean layoutRequested = mLayoutRequested && !mStopped; if (layoutRequested) { - // Execute enqueued actions on every layout in case a view that was detached - // enqueued an action after being detached - getRunQueue().executeActions(attachInfo.mHandler); final Resources res = mView.getContext().getResources(); |
