Closed

Description
I have two activities named AActivity and BActivity, I want to cache a picture but not show it in the AActivity, then when it turns to BActivity, I hope it should show from the cache, I try to use the downloadOnly
to cache the image:
Glide.with(context).load(url).downloadOnly(620, 400);
In the BActivity I use the code
Glide.with(this).load(url).into(imageview);
to load the image.
But it seems not cache the image while in the BActivity it will load the image from net again.
I just want to cache the picture, and not showing it, how can I do?
Activity
TWiStErRob commentedon Dec 25, 2015
You need to tell Glide in activity B that it can use the SOURCE cache (default is RESULT):
.diskCacheStrategy(ALL)
.Note that
downloadOnly
's arguments are not used to resize the image, only the original is cached. If you want to pre-cache the resized one use the following in activity A:The transformation and size must match the ImageView's in activity B.
ghost commentedon Dec 25, 2015
@TWiStErRob Thanks, it's ok