[Q] Android DownloadManager issue
for the last few days i'm messing around with DownloadManager in my app. It kinda works, but have some issues. It downloads file fine, but when I try to open file, it say "Can't open file". Here is download manager code from my app:
Uri source = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(
//Set title and get name file download
//Replace %20 from filename with spaces
String split = url.split("/");
String filename1 = split[split.length - 1];
String filename2 = filename1.replace("%20", " ");
//Set path for save download file
//Show notification in notification bar after download
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Thath everyone would understand easier, here is some screenshots with the issue:
As you can see, it downloads file:
File is downloaded successfully:
However, when I enter "Downloads" it still shows, that the file is still in "Downloading..." state. And when I try to open it, it says "Can't Open file"
And if I enter Downloads directory with "File Manager", I can see it has been completely downloaded, and If i try to open it, it opens just fine.
Maybe anyone knows how to fix it? or where should I look for an error?
P.S. Sorry if its not so clear, but English isn't my native language.