How can I get a value from the codenameone OnOff switch state. I have searched all over the internet and I cant find an example.I want to know when its on or off. Please help. I have tried this and many other combinations but I have not got a way yet. I have also read through codename one developers manual, there is no guidance on that.
protected void onMain_AccidentCoverAction(Component c, ActionEvent event) {
String state = findAccidentCover(c).getOn();
Dialog.show("State", state, "OK", null);
}
I have also tried
protected void onMain_AccidentCoverAction(Component c, ActionEvent event) {
String state = findAccidentCover(c).getComponentState().toString();
Dialog.show("State", state, "OK", null);
}
false, or what? DoesfindAccidentCoveractually return the correctOnOffSwitch? - Ken Y-N