Java tutorial
//package com.java2s; import android.os.Bundle; import android.os.Handler; import android.os.Message; public class Main { public static void sendMessageHandler(Handler handler, int what) { Message message = new Message(); message.what = what; handler.sendMessage(message); } public static void sendMessageHandler(Handler handler, int what, Object obj) { Message message = new Message(); message.what = what; message.obj = obj; handler.sendMessage(message); } public static void sendMessageHandler(Handler handler, int what, String key, String value) { Message message = new Message(); message.what = what; Bundle bundle = new Bundle(); bundle.putString(key, value); message.setData(bundle); handler.sendMessage(message); } public static void sendMessageHandler(Handler handler, int what, String key, int value) { Message message = new Message(); message.what = what; Bundle bundle = new Bundle(); bundle.putInt(key, value); message.setData(bundle); handler.sendMessage(message); } public static void sendMessageHandler(Handler handler, int what, Bundle bundle) { Message message = new Message(); message.what = what; message.setData(bundle); handler.sendMessage(message); } }