下载后自动启动家居置换App

发布于 2024-12-14 04:52:59 字数 534 浏览 1 评论 0原文

我有一个定制的家居更换应用程序,该应用程序不会在市场上发布。我已经实现了自动更新功能,以便能够更新客户的应用程序。我的问题是,是否可以让应用程序在更新后默认启动?现在,如果用户进行更新,则会下载并安装新版本(替换旧版本),但同时 android 会启动它的默认主应用程序(可能是因为我的尚未访问),并且用户必须单击主屏幕按钮并选择我的应用程序。是否有一些指令或配置?谢谢。顺便提一句。我安装更新的目的如下:

Uri packageURI = Uri.parse("package:pl.mymeal.orders");
Intent intent = new Intent(Intent.ACTION_VIEW, packageURI);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + ApkName)), "application/vnd.android.package-archive");
startActivity(intent); 

I have a custom home replacement App, that will not be published on the market. I've implemented an autoupdate functionality to be able to update the customer's app. My question is, is it possible to make the App start defaultly after an update? Now if the user makes an update, the new version is downloaded and installed (replaces the old one), but meanwhile android starts it's default home application (probably, because my is yet not accessible) and the user has to click the home button and choose my application. Is there maybe some directive, or configuration? Thank you. Btw. I install the update with following intent:

Uri packageURI = Uri.parse("package:pl.mymeal.orders");
Intent intent = new Intent(Intent.ACTION_VIEW, packageURI);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + ApkName)), "application/vnd.android.package-archive");
startActivity(intent); 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守望孤独 2024-12-21 04:52:59

简短的回答是否定的。
考虑一下安全影响。

The short answer is no.
Think about the security implications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文