So I have done some research, and after defining you button as an object by the code
private Button buttonname;
buttonname = (Button) findViewById(R.id.butto
//as I understand it, the "this" denotes the current view(focus) in the android program
No, "this" will only work if your MainActivity referenced by this implements the View.OnClickListener, which is the parameter type for the setOnClickListener() method. It means that you should implement View.OnClickListener in MainActivity.