So due to memory issue I thought about using Facebook's Fresco library.
So this is what I did,
First I added the following dependencies,
compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'
Then I initialized it in application class,
Fresco.initialize(getApplicationContext());
Then I added SimpleDraweeView to layout file,
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/imageMessage"
android:layout_width="180dp"
android:layout_height="180dp"
/>
Then I added the code in my activity,
SimpleDraweeView gif = (SimpleDraweeView) row.findViewById(R.id.imageMessage);
ImageRequest request = ImageRequestBuilder.newBuilderWithSource (Uri.parse(url.get(position)))
.setProgressiveRenderingEnabled (true)
.build ();
DraweeController controller = Fresco.newDraweeControllerBuilder ()
.setImageRequest (request)
.setAutoPlayAnimations (true)
.build ();
gif.setController (controller);
But it's not loading images, I also tried different urls but same result, So what I'm missing...