Somebody told me the following, but I am a bit perplexed.
Please, would you be able to confirm or dispute it?
(the Fragment is
There's a Fragment lifecycle method called onDestroyView
which you should override to release any reference to the views.
Generally you should only use lateinit var
view references if your Fragment
is permanently added to the Activity
and it will not be removed.
Kotlin View Binding extensions already solve this problem by automatically clearing view cache inside onDestroyView
.