文章出處

在網上搜了下,無意中發現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();
        }

這下可以在項目中使用了


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()