How to solve? pls
# android
n
How to solve? pls
stackoverflow 6
d
your second setValue call is inside a class (your anonymous object), i suspect you meant to put it below it.
n
I solved, but not solved. Now I have a Logic ISSUE
image.png
I explain: As long as switch magnetic remains scattered, the value of fcmotordoisb in the firebase must remain at 1
d
i suspect it’s an issue somewhere in your
Button
code, something not really kotlin related
n
+David Kirchner I have 1 only more question. it's possible I solve issue of the my first screenshot, without changing that place code (fcmotordoisb.setValue(0))?
d
you could put it in an
init{}
block inside your
setOnButtonEventListener
, and then it’ll run on object creation. dunno how i feel about that code-style-wise. i think it’d be worth scouring stackoverflow for examples as folks suggested w/ their reactions, there’s going to be a fair number of opinions.