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

Published by

osedok

I am interested in Android and Web development, Open Street Map editing and looking for new things connected to the maps and spatial data. I enjoy making stuff and understanding how the stuff works. I can code in many programming languages and I am really having fun of it. When having free time I am taking care of my apps and write some content on my blog. I enjoy the countryside, which is giving me opportunities for photography. My favourite motto from Albert Einstein is: "If you can't explain it simply, you don't understand it well enough."

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s