title: Why do I get "must override a superclass method" with @Override?
body: <p>The following code generates this error message at the <code>public void onClick</code> line.</p>
  
  <blockquote>
    <p>Multiple markers at this line<br>
      - implements android.view.View.OnClickListener.onClick<br>
      - The method onClick(View) of type new View.OnClickListener(){} must override a superclass method</p>
  </blockquote>
  
  <p>I can't understand why. This code is taken from numerous examples I've seen. What can possibly be wrong?</p>
  
  <pre><code>private Button audioButton;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      audioButton = (Button) findViewById(R.id.imageButton1);
      audioButton.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View button) {
              if (button.isSelected()) {
                  button.setSelected(false);
              }
              else {
                  button.setSelected(true);
              }
          }
      });
  }
  </code></pre>