Open philippeluickx opened 8 years ago
Didn't work for me. I had it first onReume and now at onStart. I dont get the message in my Subscribe method.
In Fragment
s , registering/unregistering on onResume()
and onPause()
works good for me. Now i'm having trouble in DialogFragment
which this didn't work. So i register/unregister on onAttach()
and onDetach()
. Found thread about this: http://stackoverflow.com/questions/32165006/otto-event-no-firing
Based on http://stackoverflow.com/questions/19692711/illegalargumentexception-with-otto-event-bus-in-fragment-instance/19737191#19737191
I just lost 3 days and a lot of hair because of a usecase where my subscriber did not get an event. I changed my bus registration from onResume/onPause (which is used e.g. at https://github.com/square/otto/blob/master/otto-sample/src/main/java/com/squareup/otto/sample/LocationHistoryFragment.java#L33) to onStart/onStop and everything works.