2

I want to load GIF file on android app using java only without adding an imageview in xml file of the activity. I tried following approach but app crashes.I'm using Glide 4.+ version.

private Bitmap backgroundImg;
 Glide.with(this)
            .load(R.drawable.title.gif)
            .asBitmap()
            .into(new SimpleTarget<Bitmap>() {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<?super Bitmap> glideAnimation) {
backgroundImg = resource;
                   canvas.drawBitmap(backgroundImg, 0, 0, null); 
                }
            });
Zoe
  • 27,060
  • 21
  • 118
  • 148
user3853770
  • 193
  • 3
  • 15
  • Download it as a file and save it in local storage . You can use Default `DownloadManager` or any network client . – ADM Feb 18 '18 at 14:55

0 Answers0