Re-import Android project issue

Sometimes when you have to re-import the project or some source files on other machine or different eclipse version you may get the following error “The method onClick(DialogInterface, int) of type new DialogInterface.OnClickListener(){} must override superclass method”

The error occurs because 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).

To fix that:

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.

Advertisements