![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
广播事件
qq_36771930
加油,行动!!!
展开
-
Android eventbus初学使用代替接口回调
简单的提示一下,当我们接触eventbus的目的,就是为了减少一些复杂的接口回调,简单高效的对一下组件的通信和广播的优化,从而更清晰管理自己的项目需求,简单记录一下: 1.添加依赖: implementation 'org.greenrobot:eventbus:3.1.1' 2.这里简单的了解一下eventbus怎么去使用。 第一步(注册事件接收对象,最后接收的地方) // 注册对象 EventBus.getDefault().register(this); //该原创 2020-06-15 16:35:54 · 401 阅读 · 0 评论 -
android 广播处理
莫非就是想在不同页面修改了状态,再一个页面去同步修改相应的状态,利用好广播在 activity <-->Fragment 我们这边去定义一个广播,广播分两组,一种是静态广播,另一种是动态广播; 动态广播: 1.发送一条广播: Intent intent =new Intent("com.controller.view123"); //内容随便定义 sendBroadcast(intent); 2.接收广播: public class My...原创 2020-05-23 20:16:04 · 200 阅读 · 0 评论