onClick(View) of type new View.OnClickListener(){} must override a superclass method
原地址:http://blog.csdn.net/aeolus1019/article/details/8014798
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才能保证每个项目都不再犯此错误。
onClick(View) of type new View.OnClickListener(){} must override a superclass method的更多相关文章
- eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method
在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} must ov ...
- eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method 在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} mus
eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass met ...
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass
最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ok —————— 最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ".. ...
- Eclipse 报错The method xxx of type must override a superclass method、Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet
问题: 如上图, 没改钱@Override会报错The method run() of type must override a superclass method 原因: java1.5中继承接口是 ...
- (转)轻松解决 MyEclipse、Eclipse 编译时提示 @Override The method of type must override a superclass method 即 @Override 标注问题
刚才在把工程从其他地方导入到自己机子的 MyEclipse 下时,出现了 The method of type must override a superclass method ,提示的是实现类必须 ...
- The method of type must override a superclass method
导入android项目时,报The method of type must override asuperclass method 一堆错误, 解决方法: 将编译的jdk与使用的jdk版本一致即可.
- The method of type must override a superclass method解决方式
工程导入myeclipse时,出现问题提示:The method of type must override asuperclass? annotation:@Override的原因 查阅了一下资料, ...
- The method of type must override a superclass method解决方式(转)
今天做struts2上传文件的时候出现了这个问题: The method execute() of type UploadAction must override or implement a sup ...
- bug2 The method of type must override a superclass method解决方式(去掉@override可以)
@Override 时出错误: 解决办法是: 一. 因为你的Co ...
随机推荐
- Javasript中Date日期常用用法(正则、比较)
Date 对象用于处理日期和时间.创建 Date 对象的语法: 代码如下 复制代码 var myDate=new Date() Date 对象会自动把当前日期和时间保存为其初始值.参数形式有以下5种 ...
- 【oracle】oracle函数-数值函数
一.数值函数 1. mod(m,n) 求余函数 注意:若m或者n为null,则返回null.若n为0,则返回m的值 eg:
- 第四篇、微信小程序-icon组件
属性: 效果图: test.wxml <!--成功图标--> <icon type="success" size="40"/> < ...
- 【转】C# 后台开启 cmd执行命令
private void RunCmd(string cmd) { System.Diagnostics.Process p = new System.Diagnostics. ...
- windows 7 64 bit 使用 virtual box 的经验
本人电脑是联想thinkpad E535的机子,安装的是64bitwindows7 旗舰版 为了更好的工作,我安装了虚拟机virtualbox最新版 很不幸,我出现了多次蓝屏的情况,我换到32位系统下 ...
- UVALive 2889(回文数字)
题意:给定i,输出第i个回文数字. 分析:1,2,3,4,……,9------------------------------------------------------------------- ...
- Paying for upgrades, by Bob Arnson
Following content is reprinted from here, please go to the original website for more information. Au ...
- nginx源码分析
ngx_init_cycle 解析配置文件 完成模块中command set函数调用
- AngularJS(5)-Http
$http 是 AngularJS 中的一个核心服务,用于读取远程服务器的数据 加入下面有一个存储在web服务器上的数据,假设地址为http://TestWebData/myData.php { &q ...
- cxgrid HyperLink 鼠标显示效果
procedure TForm1.cxGrid1DBTableView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); v ...