Nakshatran
Nakshatran

Reputation: 426

How to show gif image in android?

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!..

Upvotes: 4

Views: 14447

Answers (4)

Jonathan García
Jonathan García

Reputation: 1353

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.

Upvotes: 1

Thymine
Thymine

Reputation: 9195

The Glide library supports animated gifs now: https://github.com/bumptech/glide

It is apparently based on this gist: https://gist.github.com/devunwired/4479231

Upvotes: 0

rk_P
rk_P

Reputation: 230

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).

Upvotes: 1

gandharva
gandharva

Reputation: 691

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

Upvotes: 1

Related Questions