馬上加入Android 台灣中文網,立即免費下載應用遊戲。
您需要 登錄 才可以下載或查看,沒有帳號?註冊
x
本帖最後由 kira800917 於 2013-10-11 13:36 編輯
public void FN() {
Thread networkThread = new Thread() {
@Override
public void run() {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("acc", et_id.getText().toString());
request.addProperty("pwd", et_pwd.getText().toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
sleep(500);
/** 開始呼叫 Web Service */
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive) envelope
.getResponse();
Log.i("myApp", response.toString());
flag = response.toString();
int_flag = flag.compareTo("t");
if (r_data == null) {
sleep(500);
if (int_flag == 0) {
Log.i("r_data 還沒抓到值", "!!!!!!!!!!!!!!!!");
Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putString("s_id", et_id.getText().toString());
bundle.putString("data", r_data);
intent.setClass(getActivity(), Fragment2_1.class);
intent.putExtras(bundle);
startActivity(intent);
Log.i("myApp", "ok");
}
} else {
Toast.makeText(getActivity(), "密碼錯誤!",
Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
networkThread.start();
} |
|