文章出處
文章列表
在網上搜了下,無意中發現RequestOptions還有個方法: onlyRetrieveFromCache
用了下是OK的
try { File imageFile = Glide.with(context).asFile() .apply(RequestOptions.priorityOf(Priority.HIGH).onlyRetrieveFromCache(true)) .load(image.getFullUrl()) .submit().get(); if(imageFile != null && imageFile.exists()){ if(IConfig.DEBUG) Log.d("XXX", "found the file:" + imageFile.getAbsolutePath()); } }catch (Exception e){ e.printStackTrace(); }
這下可以在項目中使用了
文章列表
全站熱搜