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
public class MainActivity extends AppCompatActivity implements View.OnClickListener
Whenever you use (this) on click events, your main activity has to implement ocClickListener. Android Studio does it for you, press alt+enter on the 'this' word.