Example usage for android.os Message Message

List of usage examples for android.os Message Message

Introduction

In this page you can find the example usage for android.os Message Message.

Prototype

public Message() 

Source Link

Document

Constructor (but the preferred way to get a Message is to call #obtain() Message.obtain() ).

Usage

From source file:Main.java

public static Message getMessage(Object obj, int what) {
    Message message = new Message();
    message.obj = obj;/*from w w  w  .j  a  v a2s  .c  om*/
    message.what = what;
    return message;
}

From source file:Main.java

public static void sendMessage(Handler handler, int what) {
    Message msg = new Message();
    msg.what = what;//from w ww. j a v a  2  s  .c om
    handler.sendMessage(msg);
}

From source file:Main.java

public static void sendMessageByWhat(Handler handler, int what) {
    Message message = new Message();
    message.what = what;//from  w w  w  . j  a v a  2  s.  com
    handler.sendMessage(message);
}

From source file:Main.java

public static void sendMessage(Handler handler, int what, Object obj) {
    Message msg = new Message();
    msg.obj = obj;/*from  w  w  w. j av  a2 s  .c o m*/
    msg.what = what;
    handler.sendMessage(msg);
}

From source file:Main.java

public static void sendMsg(Handler hander, int what, String string) {
    Message hintMsg = new Message();
    hintMsg.what = what;//from ww w  . j  a v a2  s.  c o m
    hintMsg.obj = string;
    hander.sendMessage(hintMsg);
}

From source file:Main.java

public static Message getMessage(int statusCode, byte[] responseBody) {
    Message message = new Message();
    message.what = statusCode;//ww w .j  a  v a 2  s  . c  o  m

    Bundle bundle = new Bundle(1);
    bundle.putByteArray("response", responseBody);
    message.setData(bundle);
    return message;
}

From source file:Main.java

public static void sendMessageHandler(Handler handler, int what) {
    Message message = new Message();
    message.what = what;/*from   w  w  w.  ja v a  2s. c  o m*/
    handler.sendMessage(message);
}

From source file:Main.java

public static Message createMessage(int What, Parcelable parcelable) {
    Message message = new Message();
    message.what = What;//from  www . j  a v a2s.  com
    Bundle data = new Bundle();
    data.putParcelable(ARG_PARCELABLE, parcelable);
    message.setData(data);
    return message;
}

From source file:Main.java

public static void sendMessage(Handler handler, int what, String obj) {
    Message msg = new Message();
    msg.what = what;/*  w ww .  j a va2s .  c  o  m*/
    msg.obj = obj;
    handler.sendMessage(msg);
}

From source file:Main.java

public static void sendMessage(Handler handler, int what, Object obj) {
    Message msg = new Message();
    msg.what = what;/*from  w  w  w  .jav  a 2 s.  c  om*/
    msg.obj = obj;
    handler.sendMessage(msg);
}