
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View btn1 = findViewById(R.id.button1); btn1.setOnClickListener(new ButtonClickListener()); } private class ButtonClickListener implements View.OnClickListener{ public void onClick(View v) { System.out.println("--click-----"); } }