1.构造函数

当我们要调用EventBus的功能时,比如注册或者发送事件,总会调用EventBus.getDefault()来获取EventBus实例:

public static EventBus getDefault() {
    if (defaultInstance == null) {
        synchronized (EventBus.class) {
            if (defaultInstance == null) {
                defaultInstance = new EventBus();
            }
        }
    }
    return defaultInstance;
}
View Code

相关文章:

  • 2021-05-15
  • 2021-08-28
  • 2021-10-03
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-07-05
  • 2021-11-28
猜你喜欢
  • 2021-07-19
  • 2021-04-19
  • 2021-06-18
  • 2021-05-19
  • 2021-07-23
相关资源
相似解决方案