不活动的广播接收器可以重复使用吗?
假设在清单中声明了一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。
是的,对于清单注册的接收者。
No.
Yes, for manifest-registered receivers.