Code example for Message

0
    private FrameAnimationController() { 
        throw new UnsupportedOperationException();
    } 
 
    public static void requestAnimationFrame(Runnable runnable) {
        Message message = new Message();
        message.what = MSG_ANIMATE;
        message.obj = runnable;
        mHandler.sendMessageDelayed(message, ANIMATION_FRAME_DURATION);
    } 
 
    public static void requestFrameDelay(Runnable runnable, long delay) {
        Message message = new Message();
        message.what = MSG_ANIMATE;
        message.obj = runnable;
        mHandler.sendMessageDelayed(message, delay);
    } 
 
    private static class AnimationHandler extends Handler {
        public void handleMessage(Message m) {
            switch (m.what) {