From: http://www.oschina.net/question/12_17487
A long time ago my own android game project, today with eclipse re-open reported a bunch of errors, are related to @ override, Google find a solution (http://blog.csdn.net/skylen/archive/2011/02/21/6198699.aspx ):
Mbutton1.setonclicklistener (New button. onclicklistener () {@ override public void onclick (view v) {// todo auto-generated method stub mtextview1.settext ("Hi, everyone !! ");}});
The above code reports the following error:
-Implements Android. View. View. onclicklistener. onclick
-The method onclick (view) of type new view. onclicklistener () {} must override a superclass
Find the JDK version. The project attribute is incorrect. ----> the complier compliance level in javacompiler changes 1.5 to 1.6.
That is to say, the Java 1.5 compiler overwrites the method of the parent class by default and uses @ override to describe it; but 1.6 has extended to the method of the interface; therefore, an error occurs if it is still compiled using the Java 1.5 compiler.
The Java compiler is of version 1.6 and the compilation level is 1.6. However, it is important to select the android library of build as 1.5, the generated APK program can run on the 1.5 kernel.
In general, the android SDK version and Java JRE version can be configured and used. The relationship between the two versions should be loose.