补充: 单选清空: RadioButton1.setChecked(false);
失之毫厘,谬之千里啊,网上就一错误代码让我用上了,调了半天,下面是正确的
CheckBox cb = (CheckBox)this.findViewById(R.id.cb);
//绑定监听器
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
{ @Override
public void onCheckedChanged(CompoundButton arg0, boolean isChecked)
{
if(isChecked)
{ Toast.makeText(LoginActivity.this,"选中了" , Toast.LENGTH_LONG).show(); }
}
});