I would like to communicate between 2 Activity. Both are the register() and the unregister() methods:
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}
The ActivityB is started when I click in my list (item selection). The aim of ActivityB is to update some informations, and to send these new informations to ActivityA; so in ActivityB I call:
EventBus.getDefault().post(new MyNewEvent(bla bla bla));
In my ActivityA I have this method:
public void onEvent(MyNewEvent event) {
...
}
Unfortunately this method onEvent is never called. Why ? Because when ActivityB starts the method onStop() in ActivityA is called, so the unregister with the bus is done...
So how to communicate in this case between these 2 Activity by using EventBus ?
Thank you guys!