Android/Facebook/Eclipse – Must Override a Superclass Method

I’m trying to get into developing apps for Android and developing an Android Facebook app seemed like an good place to start with something useful.  However it seems frought with problems that will perplex the beginner.

One early problem I encountered which had a non-0bvious solution was the message:

The method onCancel() of type new Facebook.DialogListener(){} must override a superclass method

This occurred after pasting some example code from the Facebook site into my project.  The problem?  My project was defaulting to JDK 1.5 and the code on the Facebook site requires 1.6!

It’s been a while since I looked at Java but the problem is apparently due to the use of the “@override” syntax. According to one helpful StackOverflow member, in Java 1.6 this can also be used to implement interface methods, but in 1.5 could only be used to override superclass methods.

Author: nerd.

An experienced IT professional, I used to run a number of small websites and spend a lot of time tinkering with my sites or my PC - back when I had free time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.