Skip to content Skip to sidebar Skip to footer

Is An Event Bus Unregister Necessary

I'm implementing MVP pattern in Android and I'm using EventBus to let know the Presenter from activity 'A' that something happen at activity 'B' to update views from 'A'. I registe

Solution 1:

  1. Unregister is important and when user leaves application that does not mean the resources are cleaned instantly
  2. Since the EventBus holds static reference to presenter it is not freed until OS kills the process and so, considered as leak.

As for nucleus.presenter.Presenter it will be common to register on onTakeView(ViewType view) and unregister on onDropView() since event handling changes the view


Post a Comment for "Is An Event Bus Unregister Necessary"