标签:android style color java io cti new size
通常 我们大部分广播接收器的作用是为了处理我们的应用业务,
在广播机制中,Android提供了LocalBroadcastManager类来为我们应用安全保驾护航
1.创建LocalBroadcastManager:
final LocalBroadcastManager localBroadcastManager=LocalBroadcastManager.getInstance(this);
2.通过LocalBroadcastManager发送广播
Intent intent=new Intent(); intent.setAction("org.lean.action.MyBroadCastReceiver"); localBroadcastManager.sendBroadcast(intent);
3.动态注册广播接收器.(所有能接收该信息的接收器都必须为LocalBroadcastManager的实例)
IntentFilter filter=new IntentFilter(); filter.addAction("org.lean.action.MyBroadCastReceiver"); localBroadcastManager.registerReceiver(new MyBroadCastReceiver(),filter);
Android-本地广播提高安全性,布布扣,bubuko.com
标签:android style color java io cti new size
原文地址:http://blog.csdn.net/qq285016127/article/details/38685183