Hello. I'm working on a game that requires drawing to SurfaceView's
Canvas. I'm using SurfaceHolder to obtain Canvas to draw to, and
perform drawing in a separate thread. Everything I draw displays
correctly except for this one animation.

Here is the animation definition (it is in res/drawable/
my_animation.xml:

<animation-list xmlns:android="http://schemas.android.com/apk/res/
android"
                android:oneshot="false">
    <item android:drawable="@drawable/non_empty"
android:duration="250" />
    <item android:drawable="@drawable/empty" android:duration="250" />
 </animation-list>

and here is how I draw it to the Canvas:

                AnimationDrawable ad = (AnimationDrawable) getResources
().getDrawable(R.drawable.my_animation);
                ad.draw(canvas);
                ad.start();

but only the first frame ever appears on the screen.

What am I missing?

Thank you

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to