If i navigate to the second tab and navigate back the value ist false and not the last state i set ?why?
d
Desmond Teo
03/08/2021, 3:56 PM
it is likely that the declared variable is no longer in composition when you navigate to the other tab. one way to resolve this is to hoist the isPlayingState out of the scaffold of your content
j
jaqxues
03/08/2021, 4:14 PM
Or, depending on how ViewModels are scoped, put the state into the viewModel
i
izyaboi
03/08/2021, 4:22 PM
mhmh
izyaboi
03/08/2021, 4:27 PM
i dont set the value in a viewmodel right now all i do is call a home composable with a player composable and set the remember value and the click event .in my scafold