我有问题。我正在将网站上的图片下载到android-app中 与下载管理器。作为目的地,我输入了以下内容:
request?.setDestinationInExternalPublicDir(
Environment.DIRECTORY_DOWNLOADS +
File.separator + ".my_app", name + ".jpg"
)
,效果很好。目录现在是:
file://storage/emulated/0/Download/.my_app/
但是,如果我将与参数相同的变量放入Glide中,就像这样:
Glide.with(this)
.load(Environment.DIRECTORY_DOWNLOADS +
File.separator + ".my_app/" + name + ".jpg")
我收到这样的错误:
W/Glide: Load failed for Download/.my_app/pic15.jpg with size [388x388]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There were 3 causes:
java.io.FileNotFoundException(/Download/.my_app/pic15.jpg (No such file or directory))
java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
在我看来,就像Glide没注意到“下载”之前的部分。
有什么建议吗?