purplengineer
purplengineer

Reputation: 13

How to display a GIF in a Service?

I'm building an app similar to Facebook Messenger on Android and I would like to display a GIF as the chat head/bubble. I know the chat head operates as a service and found a way to display GIFs on activities (http://android-er.blogspot.ca/2014/03/play-animated-gif-with.html), but can't get it to work for a service.

Separate, but likely related issue: I'd also like to display GIFs in the popup window (after the chat head is opened).

Upvotes: 1

Views: 215

Answers (1)

Aspicas
Aspicas

Reputation: 4497

Android actually can decode and display animated GIFs, using android.graphics.Movie class.

This is not too much documented, but is in SDK Reference. Moreover, it is used in Samples in ApiDemos in BitmapDecode example with some animated flag.

Find here: https://stackoverflow.com/a/7772170/3626214

Upvotes: 2

Related Questions