不活动的广播接收器可以重复使用吗?

发布于 2024-10-07 07:49:45 字数 161 浏览 0 评论 0原文

假设在清单中声明了一个 BroadcastReceiver。它已运行一次 onReceive(),并且是托管进程中的唯一组件。如果广播另一个 Intent,每次都会产生一个新进程,或者如果旧进程没有被杀死,是否会重用?

换句话说: onReceive() 方法是否只对每个接收者对象运行一次?

Let's say a BroadcastReceiver is declared in the manifest. It has run through onReceive() once and is the only component in the hosting process. What if another Intent is broadcast, is a new process spawn every time, or would the old one be reused if it hasn't been killed?

In other words: Is the onReceive()-method only run through ONCE for each receiver object?

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

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

发布评论

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

评论(1

和影子一齐双人舞 2024-10-14 07:49:45

如果旧的没有被杀死,还会被重用吗?

不。

onReceive() 方法是否仅对每个接收者对象运行一次?

是的,对于清单注册的接收者。

would the old one be reused if it hasn't been killed?

No.

Is the onReceive()-method only run through ONCE for each receiver object?

Yes, for manifest-registered receivers.

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