google / iosched

The Google I/O Android App
Apache License 2.0
21.77k stars 6.2k forks source link

viewLifecycleOwner in DialogFragment never initialized #343

Closed IonutNegru87 closed 3 years ago

IonutNegru87 commented 4 years ago

I noticed the ThemeSettingDialogFragment does not use the viewLifecycleOwner, but the reference to itself. The recommendations show that we should use the Fragment viewLifecycleOwner, but this will never be initialized because of how the DialogFragment is created, through onCreateDialog() method.

I do not know if this is a bug in the Fragments or in the Lifecycle dependency, but I failed to update this to work correctly.

lrnrzg commented 3 years ago

you can find more from DialogFragment lifecycle

IonutNegru87 commented 3 years ago

Closing this as it seems that the documentation covers that case. Seems to be more a lint issue not properly detecting the owner.