事件处理流程
代码格式:
Button btn1 = findViewById(R.id.btn1);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),
"监听到单击事件" ,Toast.LENGTH_SHORT).
show();
}
});