volley(5) 参数total_remain:totalqty, data:[{ bar_status:XX , bar_code: "XX",bar_remain:XX, bar_whcode:"XX" , bar_prodcode:"XX",bar_id:XX,bar_location: "XX", pr_detail: "XX" , bar_batchcode:method:POST
2016-06-07 20:21
183 查看
1. 来源 : WHCombineBatchFragment.java
2. 部分代码
2. 部分代码
WHCombineBatchFragmentCombineBtnClickEvent whc2; private void combineBtnClickEvent() { String str = SharedPreUtil.getString(getActivity(), SharedPreUtil.KEY_URI); LogUtil.e("URIIIII", str); IPPORT ip = JsonTools.parseJsonToBean(str, IPPORT.class); LogUtil.e("msg", "ssss" + ip.uriArray.get(0).ip); LogUtil.e("msg", "ssss" + ip.uriArray.get(0).port); Map<String, String> params = new HashMap<>(); params.put("total_remain", tvToatal.getText().toString().trim()); params.put("data", strDataList); JSONObject jsonObject = new JSONObject(params); LogUtil.e("or_barcode", jsonObject.toString()); String url = "http://" + ip.uriArray.get(0).ip + ":" + ip.uriArray.get(0).port + Url.COMBINEBTNCLICKEVENT + "?total_remain=" + tvToatal.getText().toString().trim()+"&data="+strDataList; stringRequest2 = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String s) { LogUtil.e("combineBtnClickEvent onResponse =", s); whc2 = JsonTools.parseJsonToBean(s, WHCombineBatchFragmentCombineBtnClickEvent.class); dataPrintList.add(whc2.message); strPrintDataList= new Gson().toJson(dataPrintList); LogUtil.e("strPrintDataList", strPrintDataList); initPopuptWindow(whc2.message.bar_code, whc2.message.bar_remain); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { LogUtil.e("combineBtnClickEvent volleyError =", new String(volleyError.networkResponse.data)); Toast.makeText(getActivity().getApplicationContext(), new String(volleyError.networkResponse.data), Toast.LENGTH_SHORT).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map map = VolleyUtil.getVolleyUtil().setCookies(); //不用改动 map.put("Content-Type", "text/html; charset=UTF-8"); return map; } //不用改动 @Override public byte[] getBody() throws AuthFailureError { byte[] paramByte = new byte[0]; try { //pararm为要传递的参数 paramByte = strDataList.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } Log.e("getBody", new String(paramByte)); return paramByte; } }; stringRequest2.setTag(COMBINEBTNCLICKEVENT); mRequestQueue.add(stringRequest2); }
相关文章推荐
- 在学习QT过程中调试slot出现的问题
- qt中的委托-简单的应用
- QT学习笔记(丁松林课程讲解)
- Qt.fontFamilies 字体枚举
- Qt学习之路_3(VS下Qt的信号与槽初次体验)
- Qt学习之路(40): QTreeWidget
- Qt学习之路(47): 自定义Model之三
- Qt学习之路(46): 自定义model之二
- Qt学习之路(35): Qt容器类之顺序存储容器
- Qt学习之路(36): Qt容器类之遍历器和隐式数据共享
- Qt学习之路(42): QStringListModel
- Qt学习之路(39): QListWidget
- Qt学习之路(38): model-view架构
- Qt学习之路(37): Qt容器类之关联存储容器
- Qt学习之路(45): 自定义model之一
- A previous installation of Qt5 Visual Studio Add-in was detected. Please uninstall it before running
- QT4.84The GDB process crashed
- Qt学习之路(43): QDirModel
- Qt学习之路(42): QStringListModel
- Qt学习之路(44): QSortFilterProxyModel