以编程方式重新启动主页

发布于 2024-09-16 15:32:27 字数 81 浏览 2 评论 0原文

我正在Android上开发。我必须重新启动主页及其所有组件(小部件、快捷方式等)。 例如,当我们强制关闭时,主屏幕会重新启动并重新加载其所有组件。

I'm developing on Android. I have to restart home and all its components (widgets, shortcuts, etc..).
For example, when we have a Force Close, the home screen restart and reload all its components.

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

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

发布评论

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

评论(2

行雁书 2024-09-23 15:32:32

您应该能够重新启动它 ACTION_MAIN 和 CATEGORY_HOME 意图。如果您刚刚杀死了该应用程序,那么这应该会重新启动它。

You should be able to relaunch it ACTION_MAIN and CATEGORY_HOME intent. If you've just killed the app then this should restart it.

不爱素颜 2024-09-23 15:32:31

我必须重新启动主页及其所有组件(小部件、快捷方式等)。

不,你不知道。

例如,当我们强制关闭时,主屏幕会重新启动并重新加载其所有组件。

如果您有“强制关闭”,则无法执行代码。因此,你想要的东西是不可能的。

I have to restart home and all its components (widgets, shortcuts, etc..).

No, you don't.

For example, when we have a Force Close, the home screen restart and reload all its components.

If you have a "Force Close", you cannot execute code. Hence, what you want is impossible.

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