You haven't implemented the listener on the Buttons
yet, or at least haven't shown it. You should have something like
Button btn1 = (Button) findViewById(R.id.button1);
btn1.setOnClickListener(this);
inside your onCreate()
after setContentView()
. You would need this for each Button
.
Since you are trying to clean up your code and make it more condensed, you can set the onClick()
in your xml.
I have explained it in this answer and this one