我想将字符串响应解析为整数,但它给出零值。响应为“-1” Plz帮助。
// Invoke web service
androidHttpTransport.call(SOAP_ACTION, envelope);
// Get the response
SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
// Assign it to boolean variable variable
String value = response.toString();
loginStatus = Integer.getInteger(value);
答案 0 :(得分:0)
Integer.getInteger(prop_name)返回name' prop_name'的系统属性的值。 正确的解析将是: loginStatus = Integer.parseInt(value);