为什么覆盖不能正常工作?
我正在看一个教程,确切地说是这个 - http://android-er.blogspot.com/2011/01/start-camera-auto-focusing-autofocus.html
我下载了作者提供的文件,当我将它们添加到eclipse中时,我得到了错误无处不在,当我单击每个错误时,它会说删除@override,当我这样做时,它没有错误,但实际的应用程序无法工作。我做错了什么吗?
I was looking at a tutorial, this one to be exact - http://android-er.blogspot.com/2011/01/start-camera-auto-focusing-autofocus.html
And I downloaded the files the author provided, and when i added them into eclipse, I got errors all over the place, and when I click each one it is saying remove the @override, and when I do it is error free, but the actual application wouldn't work. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将eclipse中的“源合规模式”更改为6或更高。在旧版本的 java 中,@Override 注释对接口中的方法无效(仅在父类中实际定义的方法中)。打开窗口>首选项对话框,然后浏览至 Java >编译器。您可以在此处将“编译器合规级别”设置为 1.6。
Change the "source compliance mode" in eclipse to 6 or higher. In older versions of java, the @Override annotation was not valid on method from an interface (only in those actually defined in a parent class). Open the Window > Preferences dialog, and browse to Java > Compiler. There you can set the "Compiler compliance level" to 1.6.
你的“gen”文件夹里有“东西”吗?如果您没有这样做,是因为 ADT 插件无法正常工作(您会经常发现这种情况)
首先:
- 单击菜单栏上的“项目”
如果不起作用,请尝试以下操作:
如果第二种方法不起作用,请尝试重复它。第二次或第三次
Do you have "something" in your "gen" folder? If you havent is because the ADT plugin is not working (you'll find this pretty often)
First:
- Click on "Project" on the menu bar"
If it didnt work try this:
If the second method didnt work try repeating it. Some times works the second or thrid time