Android 替代粘性广播的机制示例是什么?

Android 替代粘性广播的机制示例是什么?,android,sticky-broadcast,Android,Sticky Broadcast,粘性广播已被弃用。文件说: This method was deprecated in API level 21. 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

粘性广播已被弃用。文件说:

This method was deprecated in API level 21. 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**. 
这种机制的一个可能例子是什么?
我应该采取什么方法?

非粘性广播的示例

android.location.PROVIDERS_CHANGED
这意味着位置提供者发生了变化,应用程序必须检查提供者以查看其当前状态。可能是用户在其设备中打开了GPS无线电。该应用程序在运行并检查位置提供商之前不知道

粘性广播的另一个问题是广播消息中的信息可能过时