在Android中,此代碼是否驗證複選框被單擊以取消選中?如何驗證複選框即將被取消選中?
public void onClick(View v) {
if (((CheckBox) v).isChecked()) {
Toast.makeText(IdentifyActivity.this, "clicked to check", Toast.LENGTH_LONG);
}
else{
Toast.makeText(IdentifyActivity.this, "clicked to uncheck", Toast.LENGTH_LONG);
}