Hello,
I'm making a function that deletes images that are 5 days old through File.getLastModified()
The way I'm loading an image is this one
Glide.with(getContext())
/**
* Save in cache, but we say to load it from cache. Otherwise it will throw an error
*/
.setDefaultRequestOptions(defaultDiskStrategy()
.onlyRetrieveFromCache(true))
.load(cachedSplashScreenUri)
.listener(object : RequestListener<Drawable> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>?, isFirstResource: Boolean): Boolean {
/**
* And when that error is thrown, we preload the image for the next time.
*/
splashActivityViewPresenter.showLogo()
loadImageInCache(cachedSplashScreenUri)
return true
}
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
/**
* TODO I need to know what's the File coming from
*/
return false
}
})
.into(mainIV)
I tried .asFile() but I get an exception so I can't get the resource as File. I would like to have that File to modify the lastModified variable inside.
Hello, I'm making a function that deletes images that are 5 days old through
File.getLastModified()
The way I'm loading an image is this one
I tried
.asFile()
but I get an exception so I can't get the resource asFile
. I would like to have thatFile
to modify thelastModified
variable inside.How can I do that?