【发布时间】:2010-08-16 05:59:18
【问题描述】:
我在附带定义的 android 文档中遇到了这个术语
这些是广播,其数据在完成后由系统保存,以便客户端可以快速检索该数据而无需等待下一次广播。
这是什么意思?有人可以用一个特定的例子详细说明它的用途吗?我相信我们必须请求许可才能使用此意图?为什么会这样?
<uses-permission android:name="android.permission.BROADCAST_STICKY"/> - Allows an application to broadcast sticky intents.
【问题讨论】:
-
08/Feb/2019,适用于任何搜索粘性广播并在此处结束的人,来自 official doc
Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired.