electrolobzik
05/03/2024, 1:03 PMprivate val receivedMediaComponent by lazy { receivedMediaComponent(childContext("receivedMediaComponent"))
}
do I need any additional setup to make lifecycle of the component work correctly? It doesn’t receive onResume events when I call bringToFront()
, but gets it if I close/open the app. Is that expected behaviour?Arkadii Ivanov
05/03/2024, 7:32 PMbringToFront
together with the permanent component receivedMediaComponent
?electrolobzik
05/03/2024, 7:35 PMArkadii Ivanov
05/03/2024, 8:04 PMelectrolobzik
05/05/2024, 6:48 PMArkadii Ivanov
05/05/2024, 7:04 PMelectrolobzik
05/05/2024, 7:05 PMelectrolobzik
05/05/2024, 8:56 PMLazyValue
wrapper class, which holds a component and is initialized during child creation like this:
Configuration.Received -> Child.ReceivedChild(receivedMediaComponent.getOrInit {
receivedMediaComponent(componentContext)
})
And now it seems to work correctly. Thanks again!Arkadii Ivanov
05/06/2024, 6:02 PMelectrolobzik
05/06/2024, 7:39 PMbringToFront
in this particular case the component is never removed from stack and should live the same period of time as its parent holding the reference. But in general it is very important point, I should be more careful.