this is the description of the error
There should be no spaces in the onClick handler name The onClick attribute value should be the name of a method in this View's context to invoke when the view is clicked. This name must correspond to a public method that takes exactly one parameter of type View. Must be a string value, using '\;' to escape characters such as '\n' or '\uxxxx' for a unicode character.
btnClick = (Button) findViewById(R.id.button2);
txtBox1 = (EditText) findViewById(editText9);
txtBox2 = (EditText) findViewById(editText10);
btnClick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String input1 = txtBox1.getText().toString();
byte[] bytes = input1.getBytes();
final StringBuilder binary = new StringBuilder();
for (byte b : bytes) {
int val = b;
for (int i = 0; i < 8; i++) {
binary.append((val & 128) == 0 ? 0 : 1);
val <<= 1;
}
binary.append(' ');
txtBox2.setText(binary);
}
btnClick = (Button) findViewById(R.id.button3);
btnClick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ClipboardManager clipboard = (ClipboardManager)
getSystemService(Context.CLIPBOARD_SERVICE);
String text = txtBox2.getText().toString();
ClipData clip = ClipData.newPlainText("text", text);
clipboard.setPrimaryClip(clip);
Toast.makeText(getApplicationContext(), "Text Copied",
Toast.LENGTH_SHORT).show();
}
});
txtBox2 = (EditText) findViewById(editText10);
txtBox1 = (EditText) findViewById(editText9);
btnClick = (Button) findViewById(R.id.button5);
btnClick.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
txtBox2.setText("");
txtBox1.setText("");
}
});
btnClick.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
txtBox2.setText("");
String s = new String(binary);
txtBox1.setText(s);
}
});