+ 2
How to get switch checked based on different boolean variable?
I'm making an app with room database and in my form for adding items there are a few switches. I'm now working on a possibility of editing the items. When I click one it connects to a form where I can change the strings and switches. And I need the switch to be on if it was checked when added. I got that text fields show previous text, but the switches don't light up. The code that I have but doesn't work is: view.switch_seen_update.setText(args.currentMovie.seen) And text fields that work look like this : view.title_update.setText(args.currentMovie.title)
1 Resposta
0
Is not setText(), because it modifies the text associated to switch not the check/uncheck is setChecked()