Reputation: 426
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
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
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
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
Reputation: 691
You can use each frame of a gif to create an animation using AnimationDrawable.
Upvotes: 1