Load image from SD card using Glide

If you have original path of image than you have to converted to URI and showing image like this String fileName = “1.jpg”; String completePath = Environment.getExternalStorageDirectory() + “https://stackoverflow.com/” + fileName; File file = new File(completePath); Uri imageUri = Uri.fromFile(file); Glide.with(this) .load(imageUri) .into(imgView); Seems like you have URI than you have to put than URI … Read more

Recyclerview Adapter and Glide – same image every 4-5 rows

The answers here are incorrect, although they’re on the right track. You need to call Glide#clear(), not just set the image drawable to null. If you don’t call clear(), an async load completing out of order may still cause view recycling issues. Your code should look like this: @Override public void onBindViewHolder(ViewHolder holder, int position) … Read more

Glide showing error: Failed to find GeneratedAppGlideModule

Finally, I found my answer here. What I have done : Step-1 I created an empty class named GlideApp import com.bumptech.glide.annotation.GlideModule; import com.bumptech.glide.module.AppGlideModule; @GlideModule public class GlideApp extends AppGlideModule { } Note: Don’t forget to add annotation @GlideModule. Step-2 After that, I build/rebuild the project and then, replaced Glide with GlideApp.and now no need to … Read more

Set visibility of progress bar gone on completion of image loading using Glide library

Question is rather old, and I don’t know what was the situation with glide in those times, but now it can be easily done with listener (not as proposed in the answer chosen as correct). progressBar.setVisibility(View.VISIBLE); Glide.with(getActivity()) .load(args.getString(IMAGE_TO_SHOW)) .listener(new RequestListener<String, GlideDrawable>() { @Override public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) { return … Read more

Does Glide have a method for loading both PNG and SVG?

You can use Glide & AndroidSVG together to achieve your goal. There is sample from Glide for SVG.Sample Example Setup RequestBuilder requestBuilder = Glide.with(mActivity) .using(Glide.buildStreamModelLoader(Uri.class, mActivity), InputStream.class) .from(Uri.class) .as(SVG.class) .transcode(new SvgDrawableTranscoder(), PictureDrawable.class) .sourceEncoder(new StreamEncoder()) .cacheDecoder(new FileToStreamDecoder<SVG>(new SvgDecoder())) .decoder(new SvgDecoder()) .placeholder(R.drawable.ic_facebook) .error(R.drawable.ic_web) .animate(android.R.anim.fade_in) .listener(new SvgSoftwareLayerSetter<Uri>()); Use RequestBuilder with uri Uri uri = Uri.parse(“http://upload.wikimedia.org/wikipedia/commons/e/e8/Svg_example3.svg”); requestBuilder .diskCacheStrategy(DiskCacheStrategy.SOURCE) // … Read more