Khám phá cơ chế hoạt động bên trong EventBus 3.0 trên Android
1. Khở tạo đối tượng EventBus
Để sử dụng EventBus, ta thường gọi EventBus.getDefault() để lấy thực thể duy nhất:
public static EventBus getInstance() {
if (singleton == null) {
synchronized (EventBus.class) {
if (singleton == null) {
singleton = new EventBus();
}
}
}
return s ...
Đăng vào ngày 20 tháng 9 lúc 04:06