Will this cause a memory leak? Eventbus refers to the Application Object and the application object also relies on Eventbus. It looks cyclical.
It is perfectly normal to subscribe to events directly from the Application class. The OS will clear the application, and EventBus is part of this. No problems.
When do I need to unregister? Application.onTerminate () is not guaranteed to be called. If # 1 is not a problem, I think it's fine to ignore unsubscribing in the Application class.
Yes, I would also unsubscribe from Terminate, just for completeness. But you are right on the Android device, if the application is cleaned, then everything just left, so there is no need to "clear".
source share