我将文件写入Environment.DIRECTORY_DOWNLOADS,为什么无法通过“下载"应用程序看到它? [英] I write a file to Environment.DIRECTORY_DOWNLOADS, why can't I see it via the Downloads App?
问题描述
我在Environment.DIRECTORY_DOWNLOADS目录中写了一个文件(准确地说,不是下载,而是我的应用程序的SQLite数据库的转储).
I write (write, not download, to be precise it is the dump of a SQLite db of my App) a file on the Environment.DIRECTORY_DOWNLOADS directory.
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
File file = new File(path, "db.csv");
如果我使用文件浏览器浏览电话,则可以在
If I browse the phone with a file browser, I can see correctly the file in the
/storage/emulated/0/Download
目录,以及其他下载内容.
Directory, together with the other downloads.
但是,如果我打开下载应用程序,它不会显示...
But if I open the Downloads App it does not show...
要使文件也显示在Downloads App中,我该怎么做?
What do I need to do to have the file shown in the Downloads App as well?
推荐答案
下载"应用仅显示通过DownloadManager
下载的下载,而不显示目录中的所有文件.
The Downloads app only shows downloads downloaded via DownloadManager
, not all files in the directory.
这篇关于我将文件写入Environment.DIRECTORY_DOWNLOADS,为什么无法通过“下载"应用程序看到它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!