转载:https://www.shangmayuan.com/a/3b7fa0fcaa124e87bb8eb085.html
重要代码
Uri downloadFileUri = manager.getUriForDownloadedFile(downId);
File file = new File(new URI(downloadFileUri.toString()));
Cursor c = manager.query(new DownloadManager.Query().setFilterById(downId));
if(c != null){
c.moveToFirst();
int fileNameIdx = c.getColumnIndex(DownloadManager.COLUMN_LOCAL_FILENAME);
String fileName = c.getString(fileNameIdx);
File file = new File(fileName);
LogUtil.d(TAG, "安装文件:" + file.getAbsolutePath());
c.close();
}