I reinstalled my computer and tried now to import my Android project into the workspace. (File -> Import -> General -> Existing Project into Workspace)
But now I have got a strange error.
bNormal.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
gotoNextQuestion();
}
});
In the second line (@Override) eclipse always tells me there is an error:
/* Multiple markers at this line
- implements android.view.View.OnClickListener.onClick
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass Method */
This happens everywhere, where @Override is used.
I already tried to Android-Tools -> Fix Project Settings
and Project -> Clean
.
I hope somebody can help me with this strange problem.
Thanks, Mark
Try this: Go to Preferences » Java » Editor » Content Assist » Advanced. Make sure Other Java Proposals is ticked/checked. If that does not work simply close the project and reopen it.
It is because the language level is set to 5.0. Change it to 6, and all will work fine. Don't know where to set it eclipse, but in Idea it's File - Project Structure - Project Language level
It happens because OnClickListener
is an interface and in 5th Java @Override
can not be applied to a method implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With