目录 广播是Android四大组件之一,是以intent为媒介在组件间进行传播数据的一种机制。 从整体来看,广播主要有三个动作和三个角色。三个动作包含“注册广播接收器”、“发送广播”和“接收广播”;三个动作包含发送方、接收方和中间人。三者关系如下图: AMS在其中就是扮演"中间人"的角色。Receiver向AMS注册广播,AMS需要将所有必要的信息以一定的形式记录下来,当Sender发送广播以后,AMS根据广播的信息从数据容器中找到注册该广播的Receiver的信息。此外AMS还要对一些特殊情况进行处理,例如:广播是否被及时消费,如果超时会产生ANR等。 实际上,广播的注册最终是由AMS实现的,receiver只需要提供要注册信息(例如:需要监听的广播)即可。 下面列表中的信息便是receiver从AMS中获取到的信息: 广播的注册分为静态注册和动态注册两种注册方式。...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with String
Contact String, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck RackActions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with String
Contact String, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack