EventBus
EventBus copied to clipboard
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
Support custom subscribe annotation, for example: ```java @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) @Subscribe(threadMode = ThreadMode.BACKGROUND) public @interface MySubscribe{} ```
MyService.java ---------------------------- @Override public void onCreate() { super.onCreate(); EventBus.getDefault().register(this); } @Override public void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } @Subscribe(threadMode = ThreadMode.MAIN) public void onMyEvent(MyEvent event){ Log.e(TAG,"onEvent"); } -------------------------------- MyFragment.java -------------------------------...
Solves the warning mentioned in https://github.com/greenrobot/EventBus/issues/507
I am getting this error when "minifyEnabled true". java.lang.RuntimeException: Unable to start activity ComponentInfo m.d.a.g: Subscriber class and its super classes have no public methods with the @Subscribe annotation
When we register event listener by sticky, there is a risk of deadlock. Because when register a sticky event, it may invoke the event handler method, if the event handler...
I found that there is subscriberInfoIndexes field in SubscriberMethodFinder that can be set to final,And I observe that this field is only assigned in the constructor,So I set this field...
Is it possible to use EventBus on Composable function(Jetpack compose)? Thanks
As per title, are there any plans to support Java 9 module system?
I register eventbus in oncreate, but an error will be reported: no subscribers registered for event. If I change the system time back to normal, event register is success
By default, EventBus uses cached non-daemon threads and they are only removed after 60 seconds of unuse. This prevents the JVM from shutting down. `System.exit()` can of course be used...