LocalBroadcastManage被称为局部通知管理器,安全性高,效率高,适合局部通信;
用法:
1. LocalBroadcastManage对象的创建:
LocalBroadcastManage manage = LocalBrocastManage.getInstance(this);
2. 注册广播接收器:
manage.registerReceiver(broadcastReceiver,intentFilter);
3.发送广播:
manage.sendBoardcast(intent);
4.取消注册:
manage.unRegisterReceiver(broadcastReceiver);
网友评论