Override Handler.handleMessage ...

Put your problem here if it does not fit any of the other categories.

Override Handler.handleMessage ...

Postby rackham » Wed Nov 04, 2009 2:40 pm

Hello all, simple question, whats wrong here

import android.os.Handler;

public class TEst extends Handler{
@Override
public void handleMessage(Message msg){
}

@Override
public String toString(){
return "hi";
}
}

Eclpise dosent reconise handleMessage as a superclass method, says i
should remove the @Override notation.

Any idea why this is, this is silly!
rackham
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Oct 06, 2009 10:47 am

Top

Postby rackham » Wed Nov 04, 2009 2:56 pm

oh its because im an idiot...
rackham
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Oct 06, 2009 10:47 am

Postby ExxKA » Sat Nov 07, 2009 12:34 am

rackham wrote:oh its because im an idiot...


Might be :) But please provide the solution for later visitors to see.
ExxKA
Developer
Developer
 
Posts: 29
Joined: Tue Nov 03, 2009 7:16 pm
Location: Denmark

Postby rackham » Sat Nov 07, 2009 8:30 am

Sorry,

It was me relying on eclipse's too much. The Message class (the handleMessage() arg) was not imported, so eclipse couldn't reconise the overridden method for what it was. For some reason eclipse didnt highlight this, and after so many years I have come to rely on eclipse highlighting of errors!
rackham
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Oct 06, 2009 10:47 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 15 guests