onActivityCreated is deprecated, how to properly use LifecycleObserver?
问题 Google deprecate fragment’s onActivityCreated() on Android and recommend to use LifeCycleObserver: To get a callback specifically when a Fragment activity's * {@link Activity#onCreate(Bundle)} is called, register a * {@link androidx.lifecycle.LifecycleObserver} on the Activity's * {@link Lifecycle} in {@link #onAttach(Context)}, removing it when it receives the * {@link Lifecycle.State#CREATED} callback. So I try to make it in recommended way, but only state I can observe in Logcat is just