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 registered the presenter to EventBus inside in constructor but I don't see any place where I could unregister it.
public class PresenterA extends nucleus.presenter.Presenter<ViewA> {
public PresenterA() {
EventBus.getDefault().register(this);
}
public void onEvent(ChangesEvent e) {
// change views
}
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With