the @Override is optional, it's just a check to see whether you are actually overriding something as opposed to just implementing a similar method :-)

what happens if you qualify that OnClickListener to View.OnClickListener? any difference?

btw fwiw and maybe i am old-fashioned, but i hardly ever use anonymous classes. makes it hard to find stuff by functionality, you have to find it by use. not very oop, IMHO.



Hi,

I'm using eclipse 3.4/3.5 to compile a project. On my machine I get
compile errors related to the @Override tag when used with interfaces:

    Button btn = new Button();
    btn.setOnClickListener(new OnClickListener() {
        @Override // Compile error
        public void onClick(View v) {
        }
    );

The @Override tag gives a "must override a superclass method" (which
is ok by me), but how does this compile on other machines? I find
myself having to always remove these override tags when compiling
others' projects,

Thanks

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
jason.vp.engineering.particle
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to