You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Events that are posted synchronously from within the ViewModel's init block are never delivered to the Activity/Fragment.
The Activity has not yet started observing the events at this point (while the ViewModel class is being created), but they are not queued up and delivered even once observing begins.
This is correct, I'll look into providing a good solution to this. It will very rarely come up as a use case though. Usually events happen in reaction to something happening. If you always need to do something on init, there are other ways to do it.
Events that are posted synchronously from within the ViewModel's
init
block are never delivered to the Activity/Fragment.The Activity has not yet started observing the events at this point (while the ViewModel class is being created), but they are not queued up and delivered even once observing begins.
Relevant code in RainbowCakeActivity
A workaround is to call
postEvent()
from within aexecute
block, giving the Activity enough time to start observing the events.The text was updated successfully, but these errors were encountered: