However imageView won’t support gif images.
Obvious that, gif have animated content.
Using imageView you can add gif it display but just static thumbnail of picture, animation won’t be displayed.
But when you need to display gif , it’s kinda tough .
But no need to worry , we have a easy solution for you .
All you need to do is just add couple of lines into your XML file.

Let’s start.
Step 1. All of first we need to add a dependency in your Gradle file.
So copy the following line and add it to Gradle file.

compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'

Step 2: Cool, just copy and paste the following lines of code into your XML file.

<pl.droidsonroids.gif.GifTextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/gif_file"/>

Yes , that’s all.
Now run …
Enjoy ..
Happy Coding


1 Comment

Pavan · October 11, 2017 at 11:10 am

It works perfectly.
thank you so much

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Android

Google firebase have introduced a new product for developers

Often google brings up the cool and get tools for developers which really helps developers in various field. If you are familiar with firebase of google then there is a new awesome tool for you Read more…