Skip to content Skip to sidebar Skip to footer

Play Gif In Either Webview Or Custom View

In a nutshell, I have an Activity A, which applied setContentView(R.id.layout_a), and A will run for 5 seconds. I tried to define a custom View class and using Movie class to load

Solution 1:

In order to play a GIF animation in your android phone, I suggest you to use a WebView (only for Android 2.2 an higher).

A good tutorial can be found here: http://droid-blog.net/2011/10/17/tutorial-how-to-play-animated-gifs-in-android-part-3/

Be careful to clear the cache in order to play the animated GIF each time you open your WebView. Use webView.clearCache(false);

Enjoy.

Solution 2:

You can convert your GIFs to WebP format.

A few utilities are available online, this is one of them: http://www.zamzar.com/convert/gif-to-webp/

Post a Comment for "Play Gif In Either Webview Or Custom View"