You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The caching mechanism of this library is really great to reduce the used bandwidth of the user, but now I have some problem where I need your help:
Given product detail page is displayed along with a product image.
When user deletes product image
and reopens product detail page
Then product image should not be visible anymore (placeholder should be shown).
Problem:
Currently the product image will be loaded from the cache and is displayed to the user which is not expected.
I would like to have the feature to delete a single image in the cache. But I found out, this is not possible.
I found this #552 and decided to go with the 1st solution, although it has some disadvantages for the user (deletion of product images is very rare).
Calling Glide.get( getApplicationContext() ).clearDiskCache(); is not sufficient, because the image could still be in the memory. So I have to call Glide.get( getApplicationContext() ).clearMemory(); as well. But when I want to open the product detail page again, I get the following error message:
java.lang.IllegalStateException: cache is closed
at com.bumptech.glide.disklrucache.DiskLruCache.checkNotClosed(DiskLruCache.java:620)
at com.bumptech.glide.disklrucache.DiskLruCache.get(DiskLruCache.java:409)
at com.bumptech.glide.load.engine.cache.DiskLruCacheWrapper.get(DiskLruCacheWrapper.java:75)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:62)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:298)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:265)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:413)
What do I need to do to "reinitialize" Glide? Or do you have another approach to the problem?
Thanks
Ben
Glide Version: 4.3.1
Integration libraries: OkHttp3
Device/Android Version: Nexus 5X
Issue details / Repro steps / Use case background:
Glide load line / GlideModule (if any) / list Adapter code (if any):
Glide.with...
Layout XML:
<FrameLayoutxmlns:android="...
Stack trace / LogCat:
pastestacktraceand/orloghere
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
Dear development team,
I'm using Glide to display product images in my app, e.g. on product detail page:
The caching mechanism of this library is really great to reduce the used bandwidth of the user, but now I have some problem where I need your help:
Problem:
Currently the product image will be loaded from the cache and is displayed to the user which is not expected.
I would like to have the feature to delete a single image in the cache. But I found out, this is not possible.
I found this #552 and decided to go with the 1st solution, although it has some disadvantages for the user (deletion of product images is very rare).
Calling
Glide.get( getApplicationContext() ).clearDiskCache();
is not sufficient, because the image could still be in the memory. So I have to callGlide.get( getApplicationContext() ).clearMemory();
as well. But when I want to open the product detail page again, I get the following error message:What do I need to do to "reinitialize" Glide? Or do you have another approach to the problem?
Thanks
Ben
Glide Version: 4.3.1
Integration libraries: OkHttp3
Device/Android Version: Nexus 5X
Issue details / Repro steps / Use case background:
Glide load line /
GlideModule
(if any) / list Adapter code (if any):Layout XML:
Stack trace / LogCat:
The text was updated successfully, but these errors were encountered: