We are trying to preload images into cache memory to load them later (the images are located in the Asset folder of the application)
<
Use the following code to cache images without displaying them
using the downloadOnly
method if you are looking to download images from the web and store them in the diskCache:
FutureTarget future = Glide.with(applicationContext)
.load(yourUrl)
.downloadOnly(500, 500);
using preload
method if you want to load them into the Memory Cache.
Glide.with(context)
.load(url)
.preload(500, 500);
You can later use the cached images using
Glide.with(yourFragment)
.load(yourUrl)
.into(yourView);