android - Glide caching off screen images in memory -


i want load , cache images in memory , not pass them view , later on when need them loaded on ui them memory cache if existed in memory.

i tried:

glide.with().load(uri).into(new simpletarget<glidedrawable>(width,height)  {      @override      public void onresourceready(glidedrawable resource, glideanimation<? super glidedrawable> glideanimation) {     //left empty     }   } ); 

but when later on make call load uri in imageview still load path , not memory.

is there way have images cached in memory without loading them on ui?

documentation on how cache images on background thread can found here.

here example code page showing how file downloaded cache, without displaying image in ui:

futuretarget<file> future = glide.with(applicationcontext) .load(yoururl) .downloadonly(500, 500);  // can omitted if want have data cached (same goes "future" instance variable file cachefile = future.get(); 

however, make sure have configured glide such caching enabled: https://github.com/bumptech/glide/wiki/configuration


Popular posts from this blog