-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2019-03-22:BroadcastReceiver 与 LocalBroadcastReceiver 有什么区别? #11
Comments
BroadcastReceiver是针对应用间、应用与系统间、应用内部进行通信的一种方式 |
|
广播细分为三种:
普通广播是什么?
有序广播是什么?
本地广播的优点?
|
补充说明一点,现在BroadcastReceiver也不推荐使用静态注册了,8.0之后限制了绝大部分广播只能使用动态注册 |
应用内广播现在还有人用吗?已经被EventBus类似的事件替换了吧? |
1.本地广播只在app内部传播,属于进程内通信。而BroadcastReceiver则是全局通信,是进程间通信。前者更为安全。 |
BroadcastReceiver(广播接收者):是跨应用广播,利用Binder机制实现。 动态注册:1.在代码中注册,程序运行的时候才能进行;2.跟随组件的生命周期;3.动态注册的广播是由AMS(ActivityManagerService)负责的。 LocalBroadcastManager实现原理:是应用内广播,利用Handler实现。 特别注意: |
发送广播有sendBroadcast普通广播 sendOrderedBroadcast有序广播 本地广播 |
No description provided.
The text was updated successfully, but these errors were encountered: