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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
When an Activity uses a @Bean that it initializes in a background Thread (afaik, there is no other way to avoid just showing the background until after initialization), the code for initializing the bean is not thread safe, and can cause (and for me, causes) Exceptions because the instance exists, but has not received a state yet.
What happens for me is that instance_ = new Client() has been run and completed, but not instance_.init(). This happens when e.g. the user rotates the screen causing a new BackgroundThread to be started.
I managed to hack around the delay by using @UiThread(propagation = ENQUEUE) and getInstance_(Context), but I would rather not have to do all initialization of all beans on the MainThread (for performance reasons).