Skip to content

Commit fea2165

Browse files
author
Jenser Almeida
committed
Update the file name on the notification (#620)
1 parent ab53601 commit fea2165

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.background": "#1B322C",
4+
"titleBar.activeBackground": "#26463E",
5+
"titleBar.activeForeground": "#F8FBFB"
6+
}
7+
}

android/src/main/java/vn/hunghd/flutterdownloader/DownloadWorker.java

+4
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ private void downloadFile(Context context, String fileURL, String savedDir, Stri
403403
outputStream = context.getContentResolver().openOutputStream(uri, "w");
404404
} else {
405405
File file = createFileInAppSpecificDir(filename, savedDir);
406+
if (file.getName() != filename) {
407+
filename = file.getName();
408+
taskDao.updateTask(getId().toString(), filename, contentType);
409+
}
406410
savedFilePath = file.getPath();
407411
outputStream = new FileOutputStream(file, false);
408412
}

0 commit comments

Comments
 (0)