1.从网络中读取图片保存到缓存中
private String getImagePath(String imgUrl) {
String path = null;
FutureTarget<File> future = Glide.with(ViewBigImageActivity.this)
.load(imgUrl)
.downloadOnly(500, 500);
try {
File cacheFile = future.get();
path = cacheFile.getAbsolutePath();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
return path; //返回缓存图片路径
}