Android debugger 出现提示Connected to the target VM, address: 'localhost:xxxx', transport: 'socket'

1 api接口

 [HttpPost]
        public Response<int> setItemSign(string companyDB,string signPath,List<ItemConfirmData> data)
        {
            Response<int> response = new Response<int>();
            try
            {
                int result = AppApi.setItemSign(companyDB, signPath, data);
                response.Status = true;
                response.Message = result.ToString();
                response.Data = new List<int>();//如果不加这句,会导致app获取返回体时无反应
            }
            catch (Exception e)
            {

                response.Status = false;
                response.Message = e.Message;
            }

            return response;
        }

2 调api接口

            String p="?companyDB="+PublicVal.TM_COMPANY.getBindMES()+"&signPath="+path;
            HttpRequestUtil.post(mContext, PublicVal.ServerURL + PublicVal.API_setItemSign+p, mSignData,
                    new JsonCallback<ResponseBean<Object>>() {

                        @Override
                        public void onDataSuccess(ResponseBean<Object> responseBean) {                           
                            if (responseBean.Status) {
                                mHandler.obtainMessage(SignFinish_CALLBACK_SUCCESS).sendToTarget();
                            } else {
                                mMessageDia.ShowAlertMessage(responseBean.Message);
                            }
                        }

                        @Override
                        public void onError(Response<ResponseBean<Object>> response) {
                            super.onError(response);
                            closeLoadingDialog();
                            if (response.body() != null) {
                                ResponseBean<Object> body = response.body();
                                  mMessageDia.ShowAlertMessage(body.Message);
                            }
                        }
                    });

3 ResponseBean<T> 定义

public class ResponseBean<T> implements Serializable {

    public boolean Status;
    public int Code;
    public String Message;
    public T Data;


}

4 出现的错误

 

 


posted @ 2020-10-06 20:58  waityu  阅读(1586)  评论(0编辑  收藏  举报