summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/java/android/graphics/drawable/AnimationDrawable.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index e275ba8941dd..2220f96d48ce 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -62,7 +62,7 @@ import android.util.AttributeSet;
* AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
*
* // Start the animation (looped playback by default).
- * frameAnimation.start()
+ * frameAnimation.start();
* </pre>
* <p>For more information, see the guide to <a
* href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a>.</p>
@@ -192,6 +192,9 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
*/
public void addFrame(Drawable frame, int duration) {
mAnimationState.addFrame(frame, duration);
+ if (mCurFrame < 0) {
+ setFrame(0, true, false);
+ }
}
private void nextFrame(boolean unschedule) {