0

I want to use bitmap in my program without loading it to imageView but this glide function is not letting me do anything I want.

Glide.with(this /* context */)
        .using(new FirebaseImageLoader())
        .load(storageReference)
        .into(imageView);
Zoe
  • 27,060
  • 21
  • 118
  • 148
  • 1
    Possible duplicate of [How does one use glide to download an image into a bitmap?](https://stackoverflow.com/questions/27394016/how-does-one-use-glide-to-download-an-image-into-a-bitmap) – Vladyslav Matviienko Jul 20 '17 at 08:45
  • That post solved my problem but i am getting a problem. bitmap is loading after the view load. Can you help me how can I restrict my view that when bitmap is loaded view can load itself? – Umer Abdul Jabbar Jul 20 '17 at 09:04

1 Answers1

0

Try this

Glide
     .with(mContext)
     .load(URL)
     .asBitmap()       
     .error(mContext.getResources().getDrawable(R.drawable.ic_placeholder))
     .diskCacheStrategy(DiskCacheStrategy.SOURCE)
     .into(new SimpleTarget<Bitmap>() {
            @Override
            public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {

                    // use your bitmap as you wish
                }
            });
beginner
  • 528
  • 4
  • 16