1、android的广播机制包含两部分的内容
。广播(Broadcast):用于发送广播
。广播接收器(BroadcastReceiver):用于接收广播
2、BroadCast
发送广播信息,把要发送的信息和用于过滤的信息装入一个Intent对象中,然后调用Context.sendBroadcast()、sendOrderBroadcast()或sendStickyBroadcast()方法,把Intent对象以广播的方式发送出去。
Intent intent = new Intent(INTENAL_ACTION_3);
intent.putExtra("Name", "hellogv");
intent.putExtra("Blog", http://blog.csdn.net/hellogv);
sendBroadcast(intent);//传递过去
3、BroadcastReceiver
BroadcastReceiver是对发送出来的Broadcast进行过滤接受并响应的一类组件,当Intent发送以后,所有已经注册的BroadcastReceiver会检查注册时的IntentFilter是否与发送的Intent相匹配,若匹配就会调用BroadcastReceiver的onReceive()方法。所以当我们定义一个BroadcastRece