https://kotlinlang.org logo
Title
n

neuber

11/21/2018, 7:55 PM
How to solve? pls
:stackoverflow: 6
d

dpk

11/21/2018, 8:06 PM
your second setValue call is inside a class (your anonymous object), i suspect you meant to put it below it.
n

neuber

11/21/2018, 8:30 PM
I solved, but not solved. Now I have a Logic ISSUE
I explain: As long as switch magnetic remains scattered, the value of fcmotordoisb in the firebase must remain at 1
d

dpk

11/21/2018, 8:47 PM
i suspect it’s an issue somewhere in your
Button
code, something not really kotlin related
n

neuber

11/21/2018, 9:08 PM
+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

dpk

11/21/2018, 9:14 PM
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.