我想顯示數據使用Web服務。該代碼沒有給出錯誤,但按鈕點擊執行發生最多隻能嘗試的一部分,沒有什麼超出了是執行沒有錯誤,但沒有執行後嘗試catch語句
try {
Toast.makeText(getApplicationContext(), "You r in try", Toast.LENGTH_LONG).show();
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION1, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.bodyIn;
//from here nothing executes but gives no error
****if(result != null**)
{
Toast.makeText(getApplicationContext(), "You r in if", Toast.LENGTH_LONG).show();
//Get the first property and change the label text
tv1.setText(result.getProperty(0).toString());
}
else
{
Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
您是否嘗試過烘烤結果?您是如何得到 – Payal 2013-02-09 11:13:44
清潔您的項目,然後再試一次。也不用烤麪包。使用Log.i(「TAG」,「Your message」); – 2013-02-09 11:14:34
爲什麼不調試應用程序並在有問題的區域放置斷點? – 2013-02-09 12:07:12