How to show gif image in android?

14,390

Solution 1

The link have nice working example you can check this out. There are lots of tutorial over there on net, by which you can do this. As far as i know android can not play gif without webview, but this tutorial shows how to do it with image view(i haven't tried it).

Solution 2

I did it with a WebView

WebView webView = (WebView) view.findViewById(R.id.webView);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.loadUrl(URL_IMAGE);

with setLoadWithOverviewMode() and setUseWideViewPort() methods will show content fits on screen.

Solution 3

You can use each frame of a gif to create an animation using AnimationDrawable.

Share:
14,390
Nakshatran
Author by

Nakshatran

Updated on June 27, 2022

Comments

  • Nakshatran
    Nakshatran almost 2 years

    Can any one tell me how to show .gif images in android.I have Google for it, but i found some samples but those are all uncleared.Can anyone give me at least one simple sample for this?

    Suggestions please

    thanks for your precious time!..