-1

I am adding multiple images on top of each other in frame layout but it doesn't show anything. Images are loaded using glide app.

      ImageView imageView = new ImageView(this);
      imageView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 
      ViewGroup.LayoutParams.MATCH_PARENT));
      imageView.setScaleType(ImageView.ScaleType.CENTER);
      GlideApp.with(this)
            .load(url)
            .skipMemoryCache(true)
            .fitCenter()
            .onlyRetrieveFromCache(true)
            .into(imageView);

    frameLayout.addView(imageView);

Can Someone help me with it?

Zoe
  • 27,060
  • 21
  • 118
  • 148
jaydeep_gedia
  • 484
  • 2
  • 4
  • 13

1 Answers1

2

You are setting onlyRetrieveFromCache(true) which works as below as per documentation

If the image is found in the memory cache or in the disk cache, it will be loaded. Otherwise, if this option is set to true, the load will fail.

So, If your image at url is not found in cache glide will not load the image. make sure you are having image in cache or do not use this property.

karan
  • 8,637
  • 3
  • 41
  • 78