![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
EventBus
Davisxy
这个作者很懒,什么都没留下…
展开
-
EventBus源码解读文档
顺序前后有些乱,请见谅:###EventBus源码解析先看一个使用的例子:public class MainActivity extends AppCompatActivity { private TextView tvShow; private Button btnShow; @Override protected void onCreate(Bundl...原创 2018-09-30 08:36:55 · 282 阅读 · 0 评论 -
EventBus 普通事件register
EventBus 普通事件registerpublic void register(Object subscriber) { Class<?> subscriberClass = subscriber.getClass(); List<SubscriberMethod> subscriberMethods = subscriberMetho...原创 2018-10-04 11:59:25 · 973 阅读 · 0 评论 -
EventBus 普通事件的post
EventBus 普通事件的post当订阅事件完成后,就需要发送时间通知了,调用比较简单EventBus.getDefault().post(eventType);看一下post事件:/** Posts the given event to the event bus. */ public void post(Object event) { PostingThre...原创 2018-10-05 01:02:06 · 1224 阅读 · 0 评论 -
EventBus 普通事件的unregister
EventBus 普通事件的unregister/** Unregisters the given subscriber from all event classes. */ public synchronized void unregister(Object subscriber) { List<Class<?>> subscribedTypes...原创 2018-10-05 01:30:03 · 914 阅读 · 0 评论 -
EventBus 黏性事件的register
EventBus 黏性事件的register跟在普通事件的register后面:// Must be called in synchronized block private void subscribe(Object subscriber, SubscriberMethod subscriberMethod) { ...... if (subscrib...原创 2018-10-08 09:45:23 · 187 阅读 · 0 评论 -
EventBus 黏性事件的postSticky
EventBus 黏性事件的stickyEvents /** * Posts the given event to the event bus and holds on to the event (because it is sticky). The most recent sticky * event of an event's type is kept in mem...原创 2018-10-08 10:40:24 · 672 阅读 · 0 评论 -
EventBus 线程调度 threadMode
EventBus 线程调度 threadModeprivate void postToSubscription(Subscription subscription, Object event, boolean isMainThread) { switch (subscription.subscriberMethod.threadMode) { case P...原创 2018-10-08 12:05:30 · 538 阅读 · 0 评论 -
EventBus 索引SampleBusIndex
EventBus 索引SampleBusIndex// 加载索引,添加到默认配置的EventBusEventBus.builder().addIndex(new SampleBusIndex()).installDefaultEventBus();/** Adds an index generated by EventBus' annotation preprocessor. */pub...原创 2018-10-08 14:19:21 · 315 阅读 · 0 评论 -
EventBus 源码解析
EventBus 源码解析看个大图:再来一个:使用起来比较简单EventBus.getDefault().register(Object);EventBus.getDefault().unregister(Object);EventBus.getDefault().post(Object);@Subscribe(threadMode=ThreadMode.MAIN)pub...原创 2018-10-10 14:38:40 · 142 阅读 · 0 评论