Is there a way to animate on a Home Widget?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-02T04:37:49Z Indexed on 2010/04/02 4:43 UTC
Read the original article Hit count: 264

Filed under:

Hi All,

I want to use an animation on a Home page Widget, i.e. an AppWidgetProvider. I was hoping to use the "Frame Animation" technique:

http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation

which I've used successfully in an activity. But I can't translate that code to an AppWidgetProvider.

Basically, in an AppWidgetProvider, I create and work with a RemoteViews object, which AFAIK doesn't provide me with a method to get a reference to an ImageView in the layout for me to call start() on the animation. There is also not a handler or a callback for when the widget displays so I can make the start() call.

Is there another way this can be done? I suppose that I can probably do the animation on my own with very fast onUpdate() calls on the widget, but that seems awfully expensive.

© Stack Overflow or respective owner

Related posts about android