2014-10-16 87 views
0

我想將字符串響應解析爲整數,但其賦予零值。響應爲「-1」 Plz Help。如何將SoapPrimitive字符串響應解析爲整數

 // 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

Yar koi回答dedo – Bilawal 2014-10-17 09:29:06

回答

0

Integer.getInteger(prop_name)返回name'prop_name'的系統屬性的值。 正確的解析將是: loginStatus = Integer.parseInt(value);