I have registered my activity/fragment like this:
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}
I have a process which is running and posting events with its status to my subcriber method.
For instance, if the user rotates the device, onStop will be called and my activity/fragment will be unregistered and it will not listen to my process events until it register again.
If some events are posted in this short time, what will happen?
(considering that my event bus will not throw any exception because of not having any subcriber registered.)
I really want to handle situations like that when for some reason the activity/fragment is not registered and some events are being posted.
I was thinking about implementing a queue of events that are not received by subscribers so that the UI could do somthing about it when it gets registered again.