Code example for Messenger

Methods: send

0
    private void communicateService(int message, Bundle data) {
        Message msg = Message.obtain(null, message, 0, 0);
        if (data != null)
            msg.setData(data);
        try { 
            messenger.send(msg);
        } catch (RemoteException e) {
            e.printStackTrace();
        } 
    } 
 
    /** 
     * Target we publish for clients to send messages to IncomingHandler. 
     */ 
    final Messenger mMessenger = new Messenger(handler);
 
    /** 
     * a Runnable called every seconds, that is responsible to call the method 
     * to update the Pomodoro Timer View. It also sends messages to the handler. 
     */