Ok, all I'm trying to do is figure out how to create a working
AnimationDrawable in the code without XML. Can it really be that hard?
I continue to run into issues with examples that are not complete
enough (the samples provided in the SDK don't even have comments other
than the copyright notice most of the time) and documentation that is
out of date.

So the first thing I tried was just to make an AnimationDrawable, add
frames to it, draw it to the canvas once a loop, and start it. But
wait, turns out there's a bug with starting it within the same context
as when the Activity starts. So I wait until the window gets
focus...still only the first frame appears. I begin investigating and
see that maybe I have to add the AnimationDrawable to an ImageView, so
I do that and draw the ImageView to the canvas...and it's no better.
Now I'm thinking that the ImageView I added it to has to be added as a
child view to the actual view so I'm trying to figure out how to do
that. My first guess was just to do a view.addView(ImageView) but that
method doesn't exist (although I've seen it referenced a bunch of
places). This leads me to find out about the ViewManager, which
actually has an addView method. The official documentation page for it
() even says: "To get an instance of this class, call
Context.getSystemService(http://code.google.com/android/reference/
android/view/ViewManager.html)." But guess what?
Context.getSystemService() needs a string for an argument, and
although there are string constants for all sorts of managers to grab
(http://code.google.com/android/reference/android/content/
Context.html#getSystemService(java.lang.String) guess which one isn't
included in the list? That's right, the ViewManager.

AAAAAAAHHHHHHHHHHHHHHHHH!

I've run out of ideas. Seriously, is this documentation incredibly out
of date? Is AnimationDrawable just broken? I've tried everything I can
think of.

If anybody can just provide a simple example of how to get frame-by-
frame animation up and running it would be greatly appreciated.

Full disclosure: I posted previously about this same thing with some
code (http://groups.google.com/group/android-developers/browse_thread/
thread/46f0b91c8af70e4a) but no one has responded.
--~--~---------~--~----~------------~-------~--~----~
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