myButton.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if (myCheckBox.isChecked()) { myTextView1.setText(R.string.ok); } else { } } });