DiskCacheStrategy无法解析为变量

huangapple go评论65阅读模式
英文:

DiskCacheStrategy cannot be resolved to a variable

问题

什么意思?为什么它显示为“无法解析为变量”。

代码:

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

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);

答案1

得分: 0

修复 Android Studio 中的 DiskCacheStrategy:

对于这个问题,我是 Android 的新手,但我认为我找到了解决方案。

你必须完整地写成 .diskCacheStrategy(com.bumptech.glide.load.engine.DiskCacheStrategy.NONE)

或者你也可以使用 Alt + Enter,Android Studio 会为你修复成缩写形式。

通过这样做,你将使图片不存储在应用程序缓存中,这对于加载许多图片非常有用。

英文:

Fix DiskCacheStrategy in android studio:

DiskCacheStrategy无法解析为变量

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.

huangapple
  • 本文由 发表于 2020年8月19日 02:33:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/63474677.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定