List of usage examples for android.os Message Message
public Message()
From source file:com.xdyou.sanguo.GameSanGuo.java
public static void callFBLogin() { Message loginMessage = new Message(); loginMessage.what = FB_LOGIN; handler.sendMessage(loginMessage); }
From source file:net.evecom.androidecssp.activity.event.ContinueAddActivity.java
/** * //from ww w .jav a 2 s . c o m * */ private void postdata(final HashMap<String, String> entity) { new Thread(new Runnable() { @Override public void run() { Message message = new Message(); try { saveResult = connServerForResultPost("jfs/ecssp/mobile/eventContinueCtr/eventContinue", entity); if (saveResult.length() > 0) { message.what = MESSAGETYPE_01; String continueId = ""; try { BaseModel continueInfo = getObjInfo(saveResult); if (null != continueInfo) { continueId = continueInfo.get("id"); } } catch (JSONException e) { Log.e("mars", e.getMessage()); } // HashMap<String, String> map = new HashMap<String, String>(); map.put("continueId", continueId); postImage(map, filebeans, "jfs/ecssp/mobile/eventContinueCtr/continueFileSave"); } } catch (ClientProtocolException e) { message.what = MESSAGETYPE_02; Log.e("stark", e.getMessage()); } catch (IOException e) { message.what = MESSAGETYPE_02; Log.e("stark", e.getMessage()); } saveHandler.sendMessage(message); } }).start(); }
From source file:com.anyonavinfo.commonuserregister.MainActivity.java
/** * Post??//from w w w . j av a 2 s.c o m */ public void upLoad() { Log.d("dddddd", "begin"); address = edittext_address.getText().toString(); car_number = edittext_carnumber.getText().toString(); birthday = edittext_birth.getText().toString(); email = edittext_email.getText().toString(); name = edittext_userName.getText().toString().trim(); nick_name = edittext_nickname.getText().toString().trim(); mobile = edittext_userPhone.getText().toString(); vin = edittext_userVin.getText().toString(); vehicleType = edittext_userVehicleType.getText().toString(); if (!Utils.checkUserName(name) || !Utils.checkBirthday(birthday) || !Utils.checkmail(email) || !Utils.checkNickName(nick_name) || !Utils.checkMobile(mobile) || !Utils.checkType(vehicleType) || !Utils.checkVin(vin) || !Utils.check4S(orgId)) { Log.d("dddddd", "checkfail"); return; } else { try { File file = null; if (picPath != null && !"".equals(picPath)) { file = new File(picPath); } JSONObject jsonUser = new JSONObject(); jsonUser.put("padSerialNo", serialNumber); jsonUser.put("userName", name); jsonUser.put("nickName", nick_name); jsonUser.put("address", address); jsonUser.put("mobile", mobile); jsonUser.put("birthday", birthday); jsonUser.put("mail", email); jsonUser.put("vehicleInfo", vehicleType); jsonUser.put("licenseNo", car_number); jsonUser.put("storeId", orgId); jsonUser.put("vinCode", vin); jsonUser.put("cmd", type); Log.d("dddddd", "success"); String urlStr = HttpApi.URL_REGISTER + HttpApi.PADSERIANO + serialNumber + HttpApi.USERNAME + URLEncoder.encode(name, "UTF-8") + HttpApi.NICKNAME + URLEncoder.encode(nick_name, "UTF-8") + HttpApi.ADDRESS + URLEncoder.encode(address, "UTF-8") + HttpApi.MOBILE + mobile + HttpApi.BIRTHDAY + birthday + HttpApi.MAIL + email + HttpApi.VEHICLEINFO + URLEncoder.encode(vehicleType, "UTF-8") + HttpApi.LICENSENO + URLEncoder.encode(car_number, "UTF-8") + HttpApi.STOREID + orgId + HttpApi.VINCODE + vin + HttpApi.CMD + type; Log.d("url", urlStr); doPostAsyn(urlStr, file, new CallBack() { @Override public void onRequestComplete(String result) { Log.i("Sjjj--->", result.toString()); String message = GetMessage(result); if (message.equals("paramBlank")) { mHandler.obtainMessage(new Message().what = 1).sendToTarget(); } else if (message.equals("success")) { mHandler.obtainMessage(new Message().what = 2).sendToTarget(); } else if (message.equals("noData")) { mHandler.obtainMessage(new Message().what = 3).sendToTarget(); } else if (message.equals("noPad")) { mHandler.obtainMessage(new Message().what = 4).sendToTarget(); } else if (message.equals("failed")) { mHandler.obtainMessage(new Message().what = 5).sendToTarget(); } else if (message.equals("repeated")) { mHandler.obtainMessage(new Message().what = 6).sendToTarget(); } } }); } catch (Exception e) { } } }
From source file:com.xdyou.sanguo.GameSanGuo.java
public static void callFBLogout() { Message logoutMessage = new Message(); logoutMessage.what = FB_LOGOUT; handler.sendMessage(logoutMessage); }
From source file:com.xdyou.sanguo.GameSanGuo.java
public static void callFBShare(String imageName, String message) { Message shareMessage = new Message(); shareMessage.what = FB_SHARE;//from w ww.jav a 2s. c o m // ? shareMessage.obj = imageName; handler.sendMessage(shareMessage); }
From source file:com.samknows.measurement.activity.SamKnowsTestViewerActivity.java
@Override protected void onStart() { super.onStart(); // make passive metrics invisible for (int x = 1; x < 33; x = x + 1) { Message msg = new Message(); JSONObject jtc = new JSONObject(); try {//from w w w.jav a 2s . com jtc.put("type", "passivemetric"); jtc.put("metric", "" + x); jtc.put("value", ""); msg.obj = jtc; } catch (JSONException je) { Logger.e(this, "Error in creating JSONObject:" + je.getMessage()); } handler.sendMessage(msg); } }
From source file:com.cerevo.blueninja.blueninja_ble_example.MainActivity.java
/** * Set application status/*w ww .j a v a2 s .com*/ * @param stat Application state. */ private void setStatus(AppState stat) { Message msg = new Message(); msg.what = stat.ordinal(); msg.obj = stat.name(); mAppStat = stat; mHandler.sendMessage(msg); }
From source file:cn.xiaocool.android_etong.net.constant.request.MainRequest.java
public void getshopgoodlist_xiajia(final String shopid) { new Thread() { Message msg = new Message(); @Override/* w w w. j av a 2 s . c o m*/ public void run() { String data = "&userid=" + user.getUserId() + "&shopid=" + shopid + "&xiajia=1"; Log.e("data=", data); String result_data = NetUtil.getResponse(WebAddress.GETSHOPGOODLIST_XIAJIA, data); Log.e("successful", result_data); try { JSONObject obj = new JSONObject(result_data); msg.what = CommunalInterfaces.GETSHOPGOODLIST_XIAJIA; msg.obj = obj; } catch (JSONException e) { e.printStackTrace(); } finally { handler.sendMessage(msg); } } }.start(); }
From source file:com.xdyou.sanguo.GameSanGuo.java
public static void callGotoGoolePlay() { Message gotoGP = new Message(); gotoGP.what = GOTO_GOOGLE_PLAY; handler.sendMessage(gotoGP); }
From source file:com.cerevo.blueninja.blueninja_ble_example.MainActivity.java
private void setStatus(AppState stat, ValueType vt) { Message msg = new Message(); msg.what = stat.ordinal();//from w w w. j a v a2 s .c om msg.obj = stat.name(); msg.arg1 = vt.ordinal(); mAppStat = stat; mHandler.sendMessage(msg); }