I came across this term in the android documentation with the accompanying definition
These are broadcasts whose data is held by the system after being finished, so that clients can quickly retrieve that data without having to wait for the next broadcast.
What does it mean? Can someone elaborate its use with a particular example? I believe we have to request a permission for using this intent? Why so?
<uses-permission android:name="android.permission.BROADCAST_STICKY"/> - Allows an application to broadcast sticky intents.
If an Activity calls
onPausewith a normal broadcast, receiving the Broadcast can be missed. A sticky broadcast can be checked after it was initiated inonResume.Update 6/23/2020
Sticky broadcasts are deprecated.
See
sendStickyBroadcastdocumentation.Implement
Resources
Related post: What is the difference between sendStickyBroadcast and sendBroadcast in Android?
See
removeStickyBroadcast(Intent), and on API Level 5 +,isInitialStickyBroadcast()for usage in the Receiver’sonReceive.