在網上搜了下,無心中發現RequestOptions還有個方法: onlyRetrieveFromCacheapp
用了下是OK的ide
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(); }
這下能夠在項目中使用了spa