Code example for Message

0
        return sendMessageDelayed(msg, 0L);
    } 
 
    @Implementation 
    public final boolean sendMessageDelayed(final Message msg, long delayMillis) {
        messages.add(msg);
        postDelayed(new Runnable() {
            @Override 
            public void run() { 
                if (messages.contains(msg)) {
                    realHandler.handleMessage(msg);
                    messages.remove(msg);
                } 
            } 
        }, delayMillis);
        return true; 
    } 
 
    @Implementation 
    public final boolean sendEmptyMessage(int what) {
        return sendEmptyMessageDelayed(what, 0L);
    } 
 
    @Implementation 
    public final boolean sendEmptyMessageDelayed(int what, long delayMillis) {
        final Message msg = new Message();
        msg.what = what;
        return sendMessageDelayed(msg, delayMillis);
    } 
     
    @Implementation