@Override annotation error(Eclipse导入原有的Android Projects)

 

导入原有程序出现下面的errors提示:

 

Description Resource Path Location Type

The method onClick(View) of type new View.OnClickListener(){} must override a superclass method DeliverActivity.java /HelloAndroid/src/com/winse/communicate line 20 Java Problem


解决方法:

It's an implementation thing. In Java 5 vs Java 6 they changed whether you could use "Override" with an interface (since Override seems to imply that you are overriding some sort of default behavior, which you are not doing with an interface!). If you so desire, you can search in the Eclipse preferences and change it from a compilation error to a compilation warning. You code inside of the CheckBox() function looks fine to me.

通过设置eclipse的冲突可以解决这个问题。
Prefereces-->Java-->Compiler在右边的Compiler compliance level设置为1.6即可。

@Override annotation error(Eclipse导入原有的Android Projects)_第1张图片
 

你可能感兴趣的:(java,eclipse,android)