SoFunction
Updated on 2025-04-09

android @override error report solution

Phenomenon
... java: 1801: method does not override a method from its superclass @Override...

reason
Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method).

That is to say, the Java 1.5 compiler overwrites the parent class's methods by default and uses @Override for explanation; but 1.6 has been extended to the interface methods; so if it is still compiled with the Java 1.5 compiler, an error will occur.

Solution
Go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select JRE 1.6 to execute your program from eclipse.
The Java compiler is version 1.6, and the compilation level is 1.6, but the important point is that you can just choose the build android library 1.5, and the generated apk program can run on the 1.5 kernel.

Solution
In eclipse, select Window –> Preferences –> Java –> Compiler, select 1.6, if not, select onfigure Project Specific Settings in Compiler, select compiler version 1.6