From 9366ce81dbaa1c954911ef1c8d5791bb4a69d89c Mon Sep 17 00:00:00 2001 From: Robert Ly Date: Wed, 22 Feb 2012 09:29:15 -0800 Subject: [PATCH] fix bug 5942522 Change-Id: Ice16e63b42d5e8c89994d0844f62adaefc8a92a1 --- .../java/android/graphics/drawable/AnimationDrawable.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java index 07de074d48a2b..35343be8b5358 100644 --- a/graphics/java/android/graphics/drawable/AnimationDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java @@ -102,7 +102,12 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An /** *

Starts the animation, looping if necessary. This method has no effect - * if the animation is running.

+ * if the animation is running. Do not call this in the {@link android.app.Activity#onCreate} + * method of your activity, because the {@link android.graphics.drawable.AnimationDrawable} is + * not yet fully attached to the window. If you want to play + * the animation immediately, without requiring interaction, then you might want to call it + * from the {@link android.app.Activity#onWindowFocusChanged} method in your activity, + * which will get called when Android brings your window into focus.

* * @see #isRunning() * @see #stop()