我重新安装我的电脑,并试图立即汇入我的Android项目到工作区。 (文件 - >导入 - >常规 - >现有项目到工作区)
I reinstalled my computer and tried now to import my Android project into the workspace. (File -> Import -> General -> Existing Project into Workspace)
但现在我有一个奇怪的错误。
But now I have got a strange error.
bNormal.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
gotoNextQuestion();
}
});
在第二行(@覆盖)日食总是告诉我有一个错误:
In the second line (@Override) eclipse always tells me there is an error:
/* Multiple markers at this line
- implements android.view.View.OnClickListener.onClick
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass Method */
这情况比比皆是,其中@覆盖使用。
我已经尝试过 Android的工具 - >修复项目设置
和项目 - >清洁
。
This happens everywhere, where @Override is used.
I already tried to Android-Tools -> Fix Project Settings
and Project -> Clean
.
我希望有人能帮助我解决这个奇怪的问题。
I hope somebody can help me with this strange problem.
谢谢,马克
推荐答案
这是因为语言级别设置为5.0。将其更改为6,一切都将正常工作。不知道在哪里设置偏食,但知道它的文件 - 项目结构 - 项目语言水平
It is because the language level is set to 5.0. Change it to 6, and all will work fine. Don't know where to set it eclipse, but in Idea it's File - Project Structure - Project Language level
这是因为 OnClickListener
是一个接口,并在第5的Java @覆盖
不能应用于方法实现
It happens because OnClickListener
is an interface and in 5th Java @Override
can not be applied to a method implementation.
相关推荐
最新文章