https://kotlinlang.org logo
#compose
Title
# compose
n

Nat Strangerweather

04/04/2022, 3:53 PM
[UPDATED WITH SOME CODE] What happens when I exit and restart my app that means my function to update my Boolean in my room database finally works? I am trying to work out what I am missing that happens at onCreate time but does not happen otherwise. I use this code in a onClick function... 🧵
Copy code
viewModel.updateTileState(
                    tileState = SavedState(
                        index,
                        visible = false,
                        enabled = false
                    )
                )
It works the first time. Then when I reset everything and use the update function again, nothing happens. If I restart the app, the update function works again.
I'm not sure if this is strictly Compose related. If not, I'll move my question to the android thread.
l

luke_c

04/04/2022, 4:33 PM
There's not really enough information here to be able to diagnose what's happening
👍 1
n

Nat Strangerweather

04/04/2022, 4:44 PM
Fair enough, I just thought it might be something obvious to room/compose experts.
l

luke_c

04/04/2022, 5:22 PM
People might be able to help - just needs more context and more code to help us understand what we're looking at Have you tried putting breakpoints in your code to see what's being hit and what isn't?
n

Nat Strangerweather

04/05/2022, 9:12 PM
Solved it, thanks!
4 Views