xutils post:josn의 작은 문제

1509 단어
 private void submitJson(){
    HttpUtils httputils=new HttpUtils();
    RequestParams params=new RequestParams("UTF-8");
    try{
         // BUG , addBodyParameter
        //params.setBodyEntity(new StringEntity(mapToJson(Mymap), "UTF-8"));
        //params.setContentType("application/json");

        String content=et_content.getText().toString();
        String mail=et_mail.getText().toString();
     params.addBodyParameter("mail", mail);
     params.addBodyParameter("content", content);
     params.addBodyParameter("DeviceId", getDeviceId());
     params.addBodyParameter("OptionText", radioButtonText);
        
    }catch(Exception e){
        e.printStackTrace();
    }
    
    httputils.send(HttpMethod.POST, url, params,new RequestCallBack() {

        @Override
        public void onFailure(HttpException arg0, String arg1) {
            // TODO Auto-generated method stub
            Log.i("Mylog"," ");
            Toast.makeText(act, " ",Toast.LENGTH_SHORT).show();
            
        }

        @Override
        public void onSuccess(ResponseInfo arg0) {
            // TODO Auto-generated method stub
            if(arg0.statusCode==200){
                
                Log.i("Mylog"," ");
                Toast.makeText(act, " ",Toast.LENGTH_SHORT).show();
                
            }
        }
    });
    
    
}

좋은 웹페이지 즐겨찾기