标签:receive name 继承 roi intent register reg nbsp int
一、注册方式
intent.setAction("BC_One");
1.静态注册
<receiver android:name = "继承BroadcastReceiver的子类">
<intent-filter>
<action android:name = "BC_One"/>
</intent-filter>
</receiver>
2.动态注册
IntentFilter filter = new IntentFilter("BC_One");
BC2 bc = new BC2(); //这个是继承BroadcastReceive这个子类
registerReceiver(bc,filter);
动态注册优先级高于静态注册
标签:receive name 继承 roi intent register reg nbsp int
原文地址:https://www.cnblogs.com/liunx1109/p/9757091.html