I am creating AsyncTask that create a service, and now I want to send a message from the service to an AsyncTask message. my code in AsyncTask:
class ResponseHandler extends Handler { public void handleMessage(Message message) {
I hope that he will process the message from the service, correct mine if I am mistaken.
and from the service tried to do it
Message message = Message.obtain(null, MyService.ADD_RESPONSE_HANDLER); message.replyTo = messenger; try { myService.send(message); catch (RemoteException e) { e.printStackTrace(); }
but my errors cannot find the character in the lines:
MyService.ADD_RESPONSE_HANDLER message.replyTo = messenger; try { myService.send(message);
What do I need to add? Please give me a code that will do the job. Many thanks.
source share