EventBus传值
来源:互联网 发布:数据库设计原则 范式 编辑:程序博客网 时间:2024/06/05 18:31
依赖:
compile 'org.greenrobot:eventbus:3.1.1'发送:EventBus.getDefault().postSticky(bean2);//任何类型都可以传接收:EventBus.getDefault().register(this);//注册(谁接收,谁注册)@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)//粘性的接收事件,一旦发现发送的内容就可以及时的接收public void onEvent(ColorBean colorBean) { color = colorBean.getColor();} @Overridepublic void onDestroy() {//反注册 super.onDestroy(); EventBus.getDefault().unregister(this);}
阅读全文
0 0
- Eventbus传值
- EventBus传值
- 简单的EventBus传值
- EventBus两个Activity传值
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- EventBus
- Eventbus
- 顺序栈(C语言)
- About EIS Connectivity
- [webpack]我所遇见的bug:[babel] note:the code generator has deoptimised the styling...
- 初学python的一些基础知识
- 表格设计&创建表
- EventBus传值
- 使用 meson 编译代码
- 快速排序(python)
- SpringMVC4.0实现rest风格接口,json格式请求和返回
- 浏览器显示页面工作流程+Anjular页面UI闪烁原因
- 使用ArrayList集合,对其添加100个不同的元素
- 出现次数最多的整数
- 博主终于自己建站,欢迎大家访问
- Spring拦截器