onClick(View) of type new View.OnClickListener(){} must override a superclass method
来源:互联网 发布:对大量网络用语的看法 编辑:程序博客网 时间:2024/05/16 01:30
Android开发过程中代码错误报错如下:
- implements android.view.View.OnClickListener.onClick
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass
解决办法:
项目属性——javaCompiler中的 complier compliance level将1.5改为1.6
原因:
JDK版本问题。
另:
对JDK 1.5的兼容级别,@Override不得用于继承Interface的子类方法指示,只能用于继承Class的子类方法指示 对JDK1.6的兼容级别,任意继承方法均可使用@Override 注意: Tomcat 6.0及以后版本,才能提供 JDK 6.0的兼容性支持 @Override 指示子类的某个方法是override父类的某个方法,假如这个父类相应的那个方法签名没有找到,那么编译器会提示错误信息。这个注释仅仅用于子类和父类,而不能用于类和接口 作用:确保子类的方法签名和父类的一致,以保证双方的方法签名一致。
PS:改掉JDK版本之后发现其他项目也 出现类似问题,因为还是要到window——preference里面将JDK版本改成1.6才能保证每个项目都不再犯此错误。
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- 解决The method onClick(View) of type new View.OnClickListener(){} must override a superclass错误
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- 解决The method onClick(View) of type new View.OnClickListener(){} must override a superclass错误
- onClick(View) of type new View.OnClickListener(){} must override a superclass method
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclass
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclas
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclas
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclas
- Android 错误 The method onClick(View) of type new View.OnClickListener(){} must override a superclas
- 20151123-03 The method onClick(View) of type new View.OnClickListener(){} must override a superclas
- The method onClick(View) of type Activity02.MyButtonListener must override a superclass method
- The method onClick(View) of type Main must override a superclass
- 错误.@Override------ View.OnClickListener(){} must override a superclass method
- 按列复制指定次数
- apue.2e 源码在 Freebsd 9.0 下编译
- struts2中s:select标签的使用
- 记北大程郁缀教授讲座
- ELF
- onClick(View) of type new View.OnClickListener(){} must override a superclass method
- 李开复给中国大学生的第二封信
- 理解 pkg-config 工具
- hello world
- 1.面向对象的封装,构造函数!
- Apache Web Server性能测试中大量TIME_WAIT解决方法 及 Linux sysctl.conf 优化解决方案
- 一个合格的程序员应该读过哪些书
- android使用activitygroup和Scrollview的方法
- 算法研究(一) 旋转字符串的三种算法