The method onClick(View) of type oddg must override a superclass method?

后端 未结 7 1608
逝去的感伤
逝去的感伤 2021-02-19 04:23

I am occurring error like:

\"The method onClick(View) of type oddg must override a superclass method\".

I am confused where exact

相关标签:
7条回答
  • 2021-02-19 05:21

    This isn't directly appropriate to this question but you will also get this error if you haven't declared implements OnClickListener on the class declaration.

    // Wrong
    public class aClass extends Activity {
    }
    // Right
    public class aClass extends Activity implements OnClickListener {
    }
    

    This may seem dum to the more experienced coder but I'm new to this and it fooled me.

    0 讨论(0)
提交回复
热议问题