目的:
第一种:同步广播 可以同时收到消息
Intent intent=new Intent();
intent.setAction("名称");
this.sendBroadcast(intent);
第二种:有序广播 优先级高的先收到
Intent intent=new Intent();
intent.setAction("名称");
this.sendOrderedBroadcast(intent);
设置最高优先级
<intent-filter android:priority="1000">
接收注册:
<receiver android:name=".sms">
<intent-filter>
<action android:name="com.liukai"></action>
</intent-filter>
</receiver>
方法: