This is a sample project created as part of this Stackoverflow question I raised
in an attempt to isloate the issue I encounted with the LifecycleObserver.onCreate(owner: LifecycleOwner)
not being called when obsering the Application lifecycle in particalar when the applicaion is created.
It consists of 3 classes with log statements
ApplicationLifecycleObserver
- my Observer that logs onCreate, onStart and onStopMyApplication
- registers theApplicationLifecycleObserver
to theProcessLifecycleOwner
and logs when onCreate calledMainActivity
- empty activity which logs when onCreate called
However, as shown in the screen shot below this is behaved as expected. Therefore the issue I'm seeing in a production app could be related to something else 🤔