OSDN Git Service

Prevent infinite loop in the Phone UI.
authorRomain Guy <romainguy@android.com>
Wed, 10 Feb 2010 19:29:22 +0000 (11:29 -0800)
committerRomain Guy <romainguy@android.com>
Wed, 10 Feb 2010 19:29:22 +0000 (11:29 -0800)
core/java/android/view/animation/Animation.java

index 337fe58..349b7e5 100644 (file)
@@ -281,8 +281,8 @@ public abstract class Animation implements Cloneable {
      */
     public void detach() {
         if (mStarted && !mEnded) {
-            if (mListener != null) mListener.onAnimationEnd(this);
             mEnded = true;
+            if (mListener != null) mListener.onAnimationEnd(this);
         }
     }
 
@@ -776,10 +776,10 @@ public abstract class Animation implements Cloneable {
         if (expired) {
             if (mRepeatCount == mRepeated) {
                 if (!mEnded) {
+                    mEnded = true;
                     if (mListener != null) {
                         mListener.onAnimationEnd(this);
                     }
-                    mEnded = true;
                 }
             } else {
                 if (mRepeatCount > 0) {