title: Why am I not allowed to use setOnClickListener in this situation?
body: <p>This makes no sense, I am given an error saying that setOnClickListener can't be applied to MainActivity. But i've made other projects where I've never encountered this problem. What's going on?</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  Button button;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      button = ((Button) findViewById(R.id.button));
  
      button.setOnClickListener(this);
  
  }
  </code></pre>