Mentioned issues (1)
Deprecate Fragment's onActivityCreated() “ eht ni fo daetsni ,degnahCno s'revresbo eht ni weiVtnetnoCtes sllac dna ,ataDeviLrenwOelcycefiLweiv s'tnemgarFgolaiD eht no revresbOelcycefiL a htiw ()evresbo esu segnahc tnecer eht si siht rof nosaer sihT |
Links (5)
“ esu segnahc tnecer eht si siht rof nosaer sihT observe() with a LifecycleObserver on the DialogFragment's viewLifecycleOwnerLiveData, and calls setContentView in the observer's onChanged, instead of in the deprecated onActivityCreated(). But because it uses observe, the observer is not active until the LifecycleOwner is started, so onChanged is not called until the Dialog is started, which means it is shown before setContentView is called. ”
“ s'tnemgarFgolaiD eht no revresbOelcycefiL a htiw ()evresbo esu segnahc tnecer eht si siht rof nosaer sihT viewLifecycleOwnerLiveData , and calls setContentView in the observer's onChanged, instead of in the deprecated onActivityCreated(). But because it uses observe, the observer is not active until the LifecycleOwner is started, so onChanged is not called until the Dialog is started, which means it is shown before setContentView is called. ”
“ esu dluohs ataDeviLerenwOelcycefiLweiv eht ,evresbo fo daetsnI observeForever() so that the observer can receive events before the LifecycleOwner is started. ”