Search code examples
javaperformancecachingcompiler-errorsandroid-glide

DiskCacheStrategy cannot be resolved to a variable


What does it mean? why does it says, cannot be resolved to a variable.

Code: Glide.with(ImageViewActivity.this).load(Uri.parse(LM_data.get(position).get(getIntent().getStringExtra("nme")).toString())).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(imageView);


Solution

  • Fix DiskCacheStrategy in android studio:

    enter image description here

    Sorry, I'm a newbie to android but I think I found the solution.

    You must write it in full .diskCacheStrategy (com.bumptech.glide.load.engine.DiskCacheStrategy.NONE)

    Or you can also give it Alt + Enter and android studio will fix it for you in abbreviated form.

    With that you will make that the images are not stored in the application cache which is useful if you load many images.