我想使用resultsRequestSOAP对象解析下面给出的数据,以便显示消息“注册成功”如果log-cat responsecode == 1,“再试一次”如果我的活动中响应为0,我试了很多根据logcat响应显示对话框,但由于我是android的新手,我无法做到这一点。如果可能的话,请有人帮我提供代码片段 我在我的logcat中得到了响应1,0但是我希望在我的活动中显示警告对话框
总是感谢帮助......!
request.addProperty("email", email);
request.addProperty("contact", contact);
request.addProperty("fname", fname);
request.addProperty("lname", lname);
request.addProperty("gender", gender);
request.addProperty("dateofbirth", dob);
request.addProperty("password", password);
request.addProperty("latitude", 76);
request.addProperty("longitude", 82);
request.addProperty("device_id", "12345");
aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
aht.call(SOAP_ACTION, soapEnvelope);
SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;
Log.v("TAG", String.valueOf(resultsRequestSOAP));
答案 0 :(得分:0)
int result = Integer.valueOf(resultsRequestSOAP.getProprety("RegisterUserResult"));
如果不能正常工作,请尝试
resultsRequestSOAP = (SoapObject)resultsRequestSOAP.getProprety(0);
int result = Integer.valueOf(resultsRequestSOAP.getProprety("RegisterUserResult").toString());
我认为就是这样