5.1.EventBus
EventBus是干嘛的?
添加EventBus到你的项目中
通过 Gradle:
使用步骤
定义事件:
准备订阅: 声明订阅方法并添加注解@Subscribe,@Subscribe注解中可指定一个线程模型,详见thread mode:
注册并取消注册你的订阅器. 例如在Android中, 根据activities或fragments的声明周期注册和取消注册订阅器:
发送事件:
完整文档请见 getting started guide.
用法示例请见 examples.
Last updated
Was this helpful?