diff --git a/ui/switch/switch.android.ts b/ui/switch/switch.android.ts index c6b329bed..087337798 100644 --- a/ui/switch/switch.android.ts +++ b/ui/switch/switch.android.ts @@ -9,6 +9,14 @@ export class Switch extends view.View { constructor() { super(); this._android = new android.widget.Switch(application.android.currentContext); + + var that = this; + this._android.setOnCheckedChangeListener(new android.widget.CompoundButton.OnCheckedChangeListener({ + onCheckedChanged: function (sender, isChecked) { + that.updateTwoWayBinding(Switch.checkedProperty, sender.isChecked()); + that.setProperty(Switch.checkedProperty, sender.isChecked()); + } + })); } get android(): android.widget.Switch {