We can remove an ordered broadcast with abortBroadcast()
, is there a way to completely remove a sticky ordered broadcast?
removeStickyBroadcast
is exactly what you need:
public abstract void removeStickyBroadcast (Intent intent)
Since: API Level 1
Remove the data previously sent with
sendStickyBroadcast(Intent)
, so that it is as if the sticky broadcast had never happened.You must hold the
BROADCAST_STICKY
permission in order to use this API. If you do not hold that permission, SecurityException will be thrown.Parameters
intent The Intent that was previously broadcast.
http://developer.android.com/reference/android/content/Context.html#removeStickyBroadcast(android.content.Intent)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With