Tag: checkbox

如何在Android中启用或禁用checkbox

我有我的quickalert对话框4checkbox…我想要的是,当我检查[启用] 1checkbox其他3checkbox必须得到禁用..我做他们点击,但没有禁用。 我不知道该怎么做。 这是我正在寻找的: checkmrn = (CheckBox) container.findViewById(R.id.MrnCheckBox); checkmrn.setText(“By Mrn”); checkmrn.setEnabled(false); checkdate = (CheckBox) container.findViewById(R.id.dateCheckBox); checkdate.setText(“By Date”); checkname = (CheckBox) container.findViewById(R.id.nameCheckBox); checkname.setText(“By Name”); checklocation = (CheckBox) container.findViewById(R.id.locationCheckBox); checklocation.setText(“By Location”); okButton = (Button) container.findViewById(R.id.okButton); okButton.setText(“Ok”); checkmrn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (((CheckBox) v).isChecked()) { Toast.makeText(mContext, “By Mrn”, Toast.LENGTH_SHORT).show(); } } }); checkdate.setOnClickListener(new […]