Button myButton = findViewById(R.id.MyButton);
EditText editText = findViewById(R.id.MyEditText);
myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(this, editText.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…