I using a web services to get the value, make the long story short. I can get the value from webservices, for this case, the value for strVersion is 1(the for loop only return 1 record since there is only 1 record).
Now here is the problem, the result always return "Wrong: 1" instead of "OK: 1", come someone please tell me why? the datatype in MYSQL for this field is Varchar.
AndroidHttpTransport aht = new AndroidHttpTransport(URL);
aht.call(SOAP_ACTION, soapEnvelope);
SoapObject resultString = (SoapObject) soapEnvelope.getResponse();
final String[] strVersion = new String[resultString.getPropertyCount()];
for(int i =0; i<resultString.getPropertyCount(); i++)
{
SoapObject array = (SoapObject) resultString .getProperty(i);
strVersion[i] = array.getProperty(0).toString();
if(strVersion[i] == "1")
{
Toast.makeText(getApplicationContext(), "OK: " + strVersion[i], Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Wrong: " + strVersion[i], Toast.LENGTH_SHORT).show();
}
}