Types :- Local,Normal,Ordered and Sticky
Normal Broadcast
:- use sendBroadcast()
:- asynchronous broadcast
:- any receiver receives broadcast not any particular order
Ordered Broadcast
:- use sendOrderedBroadcast()
:- synchronous broadcast
:- receiver receives broadcast in priority base
:- we can also simply abort broadcast in this type
Local Broadcast
:- use only when broadcast is used only inside application
Sticky Broadcast
:- normal broadcast intent is not available any more after is was send and processed by the system.
:- use sendStickyBroadcast(Intent)
:- the corresponding intent is sticky, meaning the intent you are sending stays around after the broadcast is complete.
:- because of this others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter).
:- apart from this same as sendBroadcast(Intent).
本文详细介绍了Android中四种广播类型:正常广播、有序广播、本地广播和粘性广播的特点及使用方式。正常广播为异步发送,接收顺序无固定;有序广播按优先级同步发送,支持广播中止;本地广播仅限应用内部使用;粘性广播则保留广播数据供后续检索。

被折叠的 条评论
为什么被折叠?



