Hi guys! I’m experiencing a strange behaviour. My ...
# orbit-mvi
Hi guys! I’m experiencing a strange behaviour. My container is getting created 2 times and thus the init (
onCreate: ((state: STATE) -> Unit)?
) it’s called 2 times. I’m using jetpack compose: • ActivityA has ViewModelA and everything is ok. • ActivityB has a NavHost with 3 composable (“screens”). When they’re first created I get this 2 time problem, but after that, when I change between them, the container is created only once as expected. For now, this is the best hint I can give you, but I’ll look deeper. Any clue? Thanks for your time.
Not a lot of info to go on… Can you try debugging to see if the instance of the containerhost class is different in both cases?
also worth upgrading to compose
which came out two days ago
Yes I’m using the latest version of compose and orbit. I’ve added a console output in the ViewModel init method and its called twice, I believe this clears Orbit 😊 I’ll ask this question on #compose
phew 🙂
😊 1