📜  android switch on change - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:25.853000             🧑  作者: Mango

代码示例1
mySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        // do something, the isChecked will be
        // true if the switch is in the On position
    }
});