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:net.networksaremadeofstring.rhybudd.CoreSettingsFragment.java

private void UpdateDebugMessage(String Message) {
    Message msg = new Message();
    Bundle bundle = new Bundle();

    msg.what = RhybuddHandlers.msg_initial_verify_debug_output;
    bundle.putString(ZenossAPI.MSG_DEBUG, Message);
    msg.setData(bundle);/*from w w  w.j av a 2  s.  c  o  m*/
    handler.sendMessage(msg);
}

From source file:net.evecom.androidecssp.activity.ResponseListActivity.java

/**
 * //w w w  . ja  va 2 s.  c  om
 */
private void initlist() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            Message message = new Message();
            HashMap<String, String> hashMap = new HashMap<String, String>();
            hashMap.put("taskId", taskInfo.get("id").toString());
            try {
                resutArray = connServerForResultPost("jfs/ecssp/mobile/taskresponseCtr/getTaskResponseByTaskId",
                        hashMap);
            } catch (ClientProtocolException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            } catch (IOException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            }
            if (resutArray.length() > 0) {
                try {
                    taskResponseInfos = getObjsInfo(resutArray);
                    if (null == taskResponseInfos) {
                        message.what = MESSAGETYPE_02;
                    } else {
                        message.what = MESSAGETYPE_01;
                    }
                } catch (JSONException e) {
                    message.what = MESSAGETYPE_02;
                    Log.e("mars", e.getMessage());
                }
            } else {
                message.what = MESSAGETYPE_02;
            }
            Log.v("mars", resutArray);
            eventListHandler.sendMessage(message);

        }
    }).start();

}

From source file:net.evecom.androidecssp.activity.TaskListActivity.java

/**
 * /*  ww w  . ja  v  a 2  s .co m*/
 */
private void initlist() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            Message message = new Message();

            try {
                HashMap<String, String> hashMap = new HashMap<String, String>();
                hashMap.put("eventId", eventInfo.get("id").toString());
                hashMap.put("projectId", projectInfo.get("id").toString());
                System.out.println(hashMap.values().toArray().toString());
                resutArray = connServerForResultPost(
                        "jfs/ecssp/mobile/taskresponseCtr/getTaskByEventIdAndProjectId", hashMap);
            } catch (ClientProtocolException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            } catch (IOException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            }
            if (resutArray.length() > 0) {
                try {
                    taskInfos = getObjsInfo(resutArray);
                    if (null == taskInfos) {
                        message.what = MESSAGETYPE_02;
                    } else {
                        message.what = MESSAGETYPE_01;
                    }
                } catch (JSONException e) {
                    message.what = MESSAGETYPE_02;
                    Log.e("mars", e.getMessage());
                }
            } else {
                message.what = MESSAGETYPE_02;
            }
            Log.v("mars", resutArray);
            eventListHandler.sendMessage(message);

        }
    }).start();

}

From source file:net.networksaremadeofstring.rhybudd.ZaasSettingsFragment.java

private void UpdateDebugMessage(String Message) {
    android.os.Message msg = new Message();
    Bundle bundle = new Bundle();

    msg.what = RhybuddHandlers.msg_initial_verify_debug_output;
    bundle.putString(ZenossAPI.MSG_DEBUG, Message);
    msg.setData(bundle);//from  w ww  . j av  a  2s  . com
    handler.sendMessage(msg);
}

From source file:net.evecom.androidecssp.activity.inform.InformListActivity.java

/**
 * //from www  .ja va2 s .c  o m
 */
private void initList() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            Message message = new Message();
            HashMap<String, String> map = new HashMap<String, String>();
            userId = ShareUtil.getString(getApplicationContext(), "PASSNAME", "userid", "0");
            try {
                map.put("searchStr", searchStr);
                map.put("userid", userId);
                resultArray = connServerForResultPost("jfs/ecssp/mobile/informCtr/getInfromList", map);
            } catch (ClientProtocolException e) {
                message.what = MESSAGETYPE_02;
            } catch (IOException e) {
                message.what = MESSAGETYPE_02;
            }
            if (resultArray.length() > 0) {
                try {
                    informs = getObjsInfo(resultArray);
                    if (informs.size() == 0) {
                        message.what = MESSAGETYPE_02;
                    } else {
                        message.what = MESSAGETYPE_01;
                    }
                } catch (JSONException e) {
                    message.what = MESSAGETYPE_02;
                }
            } else {
                message.what = MESSAGETYPE_02;
            }
            informHandler.sendMessage(message);

        }
    }).start();
}

From source file:net.evecom.androidecssp.activity.event.EventContinueActivity.java

/**
 * //from  w w w.j a va2s.  co m
 * 
 * 
 * @author Stark Zhou
 * @created 2015-12-30 2:34:25
 */
private void initList() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            Message message = new Message();
            try {
                HashMap<String, String> map = new HashMap<String, String>();
                map.put("eventid", eventInfo.getStr("id"));
                resultArray = connServerForResultPost("jfs/ecssp/mobile/eventContinueCtr/getEventContinue",
                        map);
                // 
                resultArray1 = connServerForResultPost("jfs/ecssp/mobile/eventContinueCtr/getEventMonitor",
                        map);
            } catch (ClientProtocolException e) {
                message.what = MESSAGETYPE_02;
            } catch (IOException e) {
                message.what = MESSAGETYPE_02;
            }
            if (resultArray.length() > 0) {
                try {
                    eventContinue = getObjsInfo(resultArray);
                    monitorType = getObjsInfo(resultArray1);
                    if (null == eventContinue || eventContinue.size() == 0) {

                        message.what = MESSAGETYPE_02;
                    } else {
                        message.what = MESSAGETYPE_01;
                    }
                } catch (JSONException e) {
                    message.what = MESSAGETYPE_02;
                }
            } else {
                message.what = MESSAGETYPE_02;
            }
            eventContinueHandler.sendMessage(message);

        }
    }).start();
}

From source file:com.galois.qrstream.lib.DecodeThread.java

@Override
public void run() {
    Job message;//from  w ww .  j av  a 2 s  .  co  m
    try {
        message = (Job) receiver.decodeQRSerializable(cameraManager);
        Log.w(Constants.APP_TAG, "DecodeThread received " + message.getData().length + " bytes, " + "mimetype: "
                + message.getMimeType());

        Intent i = buildIntent(message);
        context.startActivity(Intent.createChooser(i, "Open with"));
    } catch (ReceiveException e) {
        Log.e(Constants.APP_TAG, "DecodeThread failed to read message. " + e.getMessage());
    } catch (IOException e) {
        Log.e(Constants.APP_TAG, "Could not store data to temp file." + e.getMessage());
    } finally {
        // The receiver has finished. Clear the UI.
        uiHandle.sendMessage(new Message());
    }
}

From source file:net.evecom.androidecssp.activity.taskresponse.TaskListActivity.java

/**
 * //  w w w.j a v  a 2 s . c  o  m
 */
private void initlist() {
    new Thread(new Runnable() {
        @Override
        public void run() {
            Message message = new Message();

            try {
                HashMap<String, String> hashMap = new HashMap<String, String>();
                String url = "";
                if (!ifmytask) {
                    hashMap.put("eventId", eventInfo.get("id").toString());
                    hashMap.put("projectId", projectInfo.get("id").toString());
                    url = "jfs/ecssp/mobile/taskresponseCtr/getTaskByEventIdAndProjectId";
                } else {
                    hashMap.put("deptid", ShareUtil.getString(instance, "PASSNAME", "orgid", ""));
                    hashMap.put("userid", ShareUtil.getString(instance, "PASSNAME", "userid", ""));
                    url = "jfs/ecssp/mobile/taskresponseCtr/getTaskByDeptIdAndUserId";
                }
                System.out.println(hashMap.values().toArray().toString());
                resutArray = connServerForResultPost(url, hashMap);
            } catch (ClientProtocolException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            } catch (IOException e) {
                message.what = MESSAGETYPE_02;
                Log.e("mars", e.getMessage());
            }
            if (resutArray.length() > 0) {
                try {
                    taskInfos = getObjsInfo(resutArray);
                    if (null == taskInfos) {
                        message.what = MESSAGETYPE_02;
                    } else {
                        message.what = MESSAGETYPE_01;
                    }
                } catch (JSONException e) {
                    message.what = MESSAGETYPE_02;
                    Log.e("mars", e.getMessage());
                }
            } else {
                message.what = MESSAGETYPE_02;
            }
            Log.v("mars", resutArray);
            eventListHandler.sendMessage(message);

        }
    }).start();

}

From source file:com.ezac.gliderlogs.TimePickerDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    // Creating a bundle object to pass currently set time to the fragment
    Bundle b = getArguments();/* w ww  . j a  v  a 2  s.  c  om*/
    mHour = b.getInt("set_hour");
    mMinute = b.getInt("set_minute");

    TimePickerDialog.OnTimeSetListener listener = new TimePickerDialog.OnTimeSetListener() {
        @Override
        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
            mHour = hourOfDay;
            mMinute = minute;
            // Creating a bundle object to pass currently set time to the fragment
            Bundle b = new Bundle();
            // Adding currently set time to bundle object
            b.putInt("set_hour", mHour);
            b.putInt("set_minute", mMinute);
            // Adding Current time in a string to bundle object
            b.putString("set_time", "Set Time : " + Integer.toString(mHour) + ":" + Integer.toString(mMinute));
            // Creating an instance of Message
            Message m = new Message();
            // Setting bundle object on the message object m
            m.setData(b);
            // Message m is sending using the message handler instantiated in MainActivity class
            mHandler.sendMessage(m);
        }
    };
    // Opening the TimePickerDialog window
    return new TimePickerDialog(getActivity(), listener, mHour, mMinute, true);
}

From source file:com.spoiledmilk.ibikecph.login.HTTPAccountHandler.java

public static Message performGetUser(final UserData userData) {
    Message message = new Message();
    JsonNode result = null;/*from  w w w  .ja va  2  s  . c  om*/
    JSONObject jsonPOST = new JSONObject();
    try {
        LOG.d("facebook api token get = " + userData.getAuth_token());
        jsonPOST.put("auth_token", userData.getAuth_token());
        result = HttpUtils.getFromServer(Config.API_SERVER_REGISTER + "/" + userData.getId() + "?auth_token="
                + userData.getAuth_token());
        message = HttpUtils.JSONtoUserDataMessage(result, userData);
        message.getData().putInt("type", GET_USER);
    } catch (JSONException e) {
        LOG.e(e.getLocalizedMessage());
        message.getData().putInt("type", ERROR);
    }
    return message;
}