android @override error reporting solution

  • 2020-05-07 20:27:17
  • OfStack

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).

This means that the compiler of Java 1.5 overrides the methods of the parent class by default, as described by @Override. But 1.6 has been extended to the methods to the interface; So if you still compile with the Java 1.5 compiler, you will get an error.

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 compiler for java is version 1.6 and the compiler level is 1.6, but the important point is that the android library for build is 1.5, and the apk program can run on the 1.5 kernel.

solution :
Select the Window pool from eclipse > Preferences � > Java � > Select 1.6 for Compiler, and if not, select onfigure Project Specific Settings from Compiler to select the compiler version 1.6

Related articles: