send OS Handler Message - Android Android OS

Android examples for Android OS:Message

Description

send OS Handler Message

Demo Code


//package com.java2s;
import android.os.Handler;
import android.os.Message;

public class Main {
    public static void sendHandlerMessage(Handler handler, int message) {
        // Try to reuse message objects
        Message msg = Message.obtain();/* w  ww .j  a  v a  2 s  .  com*/
        msg.what = message;
        handler.sendMessage(msg);
    }
}

Related Tutorials