使下载完成通知在点击安装后消失 https://gitlab.ghzs.com/pm/halo-app-issues/issues/726
This commit is contained in:
@ -247,6 +247,7 @@ public class MainActivity extends BaseActivity {
|
||||
DownloadManager.getInstance(MainActivity.this).cancel(downloadEntity.getUrl());
|
||||
} else {
|
||||
if (PackageUtils.isCanLaunchSetup(getApplicationContext(), downloadEntity.getPath())) {
|
||||
downloadEntity.getMeta().put(Constants.MARK_ALREADY_TRIGGERED_INSTALLATION, "YES");
|
||||
startActivity(PackageUtils.getInstallIntent(MainActivity.this, downloadEntity.getPath()));
|
||||
} else {
|
||||
// 弹出卸载提示框
|
||||
@ -620,12 +621,12 @@ public class MainActivity extends BaseActivity {
|
||||
} else {
|
||||
msg = "《" + downloadEntity.getName() + "》已下载完但还未安装,是否立即安装?";
|
||||
}
|
||||
final String path = downloadEntity.getPath();
|
||||
DownloadEntity finalDownloadEntity = downloadEntity;
|
||||
DialogUtils.showWarningDialog(this,
|
||||
"提示", msg,
|
||||
"直接退出",
|
||||
"立即安装",
|
||||
() -> handler.postDelayed(() -> PackageUtils.launchSetup(MainActivity.this, path), 200),
|
||||
() -> handler.postDelayed(() -> PackageUtils.launchSetup(MainActivity.this, finalDownloadEntity), 200),
|
||||
this::finish);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user