What’s the `setOwners` method on `ComponentActivit...
# compose
m
What’s the
setOwners
method on
ComponentActivity
for? The method calls •
.setViewTreeLifecycleOwner(this)
.setViewTreeViewModelStoreOwner(this)
.setViewTreeSavedStateRegistryOwner(this)
on the
window.decorView
of
this
, but its only usage (in the
setContent
method) is followed by a call to the
setContentView
on the same
ComponentActivity
receiver.
setContentView
calls
initializeViewTreeOwners
,
Copy code
open fun initializeViewTreeOwners() {
    window.decorView.setViewTreeLifecycleOwner(this)
    window.decorView.setViewTreeViewModelStoreOwner(this)
    window.decorView.setViewTreeSavedStateRegistryOwner(this)
    window.decorView.setViewTreeOnBackPressedDispatcherOwner(this)
    window.decorView.setViewTreeFullyDrawnReporterOwner(this)
}
which makes the same three calls as
setOwners
and then two more
Also could anybody also check out https://kotlinlang.slack.com/archives/CJLTWPH7S/p1762421898482089 too please?