From 49779a155f8e7f752f6433db5e132ce8d01a1d9f Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 16 Jan 2012 04:10:08 -0800 Subject: [PATCH] Fix RuntimeException in LauncherViewPropertyAnimator Bug #5869237 Change-Id: Ib1466ea7aaabc1c42626789d7c8ef48134b49bfd --- src/com/android/launcher2/Launcher.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 45a9e3118f..33ca88723b 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2312,13 +2312,18 @@ public final class Launcher extends Activity } if (delayAnim) { + final AnimatorSet stateAnimation = mStateAnimation; final OnGlobalLayoutListener delayedStart = new OnGlobalLayoutListener() { public void onGlobalLayout() { mWorkspace.post(new Runnable() { public void run() { - // Need to update pivots for zoom if layout changed - setPivotsForZoom(toView, scale); - mStateAnimation.start(); + // Check that mStateAnimation hasn't changed while + // we waited for a layout pass + if (mStateAnimation == stateAnimation) { + // Need to update pivots for zoom if layout changed + setPivotsForZoom(toView, scale); + mStateAnimation.start(); + } } }); observer.removeGlobalOnLayoutListener(this);