从我的应用程序下载的视频保存在下面创建的路径中,但没有显示在android 10的画廊中,但我已经检查了android N,它在画廊中显示。很抱歉我的英语不好!
下面是创建的路径,
File mydownload = new File(Environment.getExternalStorageDirectory().toString() + "/SavedVideos");
if (!mydownload.exists()) {
mydownload.mkdir();
}发布于 2020-12-26 15:12:54
File file = new File("data/data/your package name/test.txt");
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}发布于 2021-03-10 18:18:30
我有一个解决方案,需要使用广播意图来扫描媒体文件。
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(YOUR_PATH)));https://stackoverflow.com/questions/65454082
复制相似问题