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 ...
随机推荐
- HTML JSOgN to string
JSON.stringify(json).replace(',', ', ').replace('[', '').replace(']', '')
- 学习 .net 的一些主要网站
学习 .net 的一些主要网站 来自 http://www.cnblogs.com/trymybest121/articles/500176.html http://msdn.microsoft. ...
- C#中Excel的导入和导出的几种基本方式
在上一篇(http://www.cnblogs.com/fengchengjushi/p/3369386.html)介绍过,Excel也是数据持久化的一种实现方式.在C#中.我们常常会与Excel文件 ...
- Session 的配置和特性
session的配置 对于session的配置是php.ini中配置 session数据都是保存在文本文件中 设置session文件的保存位置 说明: 默认是保存在windows/temp目录 ...
- host文件的作用和介绍
在Window系统中有个Hosts文件(没有后缀名)在Windows98系统下该文件在Windows目录,在Windows2000/XP系统中位于C:\Winnt\System32\Drivers\E ...
- poj 3614 Sunscreen
...
- PerformSelector may cause a leak because its selector is unknown 解决方法
我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3801030.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...
- 利用Linux下的pthread_mutex_t类型来实现哲学家进餐问题
首先说一下什么是哲学家进餐问题,这是操作系统课程中一个经典的同步问题, 问题如下:如上图,有6个哲学家和6根筷子(那个蓝色部分表示哲学家,那个紫色长条部分表示筷子),他们分别被编了0~5的号!如果某个 ...
- Linux dd 命令
语法:dd [选项] if =输入文件(或设备名称). of =输出文件(或设备名称). ibs = bytes 一次读取bytes字节,即读入缓冲区的字节数. skip = blocks 跳过读入缓 ...
- 看几道JQuery试题后总结(上篇)
无意中拿到的JQuery题目,拿来分享顺便总结总结 在JQuery对象中区分.text();.val();.html();.innerHTML;.innerTEXT()的用法与区别,用例子证明 在JQ ...