Is there a way to host a fragment inside of a composable? I know we can host composables inside of a fragment but what about the opposite?
i
Ian Lake
06/25/2021, 2:56 PM
You should only use
AndroidViewBinding
to inflate a layout with a
FragmentContainerView
- that's the only setup that will automatically add and importantly remove the Fragment when you remove that
AndroidViewBinding
from your Composable hierarchy
š 4
v
Valentin Moscone
09/01/2023, 7:03 PM
Hello @Ian Lake! Are there any additional steps required, aside from following this guidance, when removing the Fragment from the Composable hierarchy? Iām encountering a memory leak issue with a Fragment after its removal, and I want to confirm if there are any known bugs or actions required on our part that you are aware of. Thanks! š
i
Ian Lake
09/01/2023, 7:05 PM
AndroidViewBinding
automatically removes the Fragment from the FragmentManager when the