How to Handle the checkbox ischecked and unchecked event in android

后端 未结 5 1620
慢半拍i
慢半拍i 2021-01-16 02:11

i am new in android.i make a simple maths apps. i use the check box for select right option but problem is here the answer option is not only one but also two,three means

5条回答
  •  一整个雨季
    2021-01-16 02:50

    checkBox_sound.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
    
                varBoolSoundOn = (isChecked) ? true : false;
    
            }
        });
    

    It works Perfect...

提交回复
热议问题