返回信息流【 以下文字转载自 Java 讨论区 】
发信人: liumoude (卖女孩的小火柴), 信区: Java
标 题: 求大神帮助我的Android毕业论文
发信站: 北邮人论坛 (Sun Apr 12 20:55:36 2015), 站内
public void onClickme(String msg){
String nameSpace = "http://WebXml.com.cn/";
String methodName = "getWeatherbyCityName";
String endPoint = "http://webservice.webxml.com.cn/WebServices/WeatherWebService.asmx";
String soapAction = "http://WebXml.com.cn/getWeatherbyCityName";
SoapObject rpc = new SoapObject(nameSpace, methodName);
rpc.addProperty("theCityName", msg);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
HttpTransportSE transport = new HttpTransportSE(endPoint);
String result = "无网络";
try {
transport.call(soapAction, envelope);
} catch (Exception e) {
e.printStackTrace();
}
SoapObject object = (SoapObject) envelope.bodyIn;
try{
result = object.toString();
}catch(Exception e){}
if(result=="无网络"){
Toast.makeText(MainActivity.this,"无网络连接",2000).show();
}
else{
Bundle bundle = new Bundle();
bundle.putString("data", result);
Intent intent= new Intent();
intent.setClass(MainActivity.this,ResultActivity.class);
intent.putExtras(bundle);
startActivity(intent);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}目前运行连不上网络,去年都可以,求帮助啊
这是一条镜像帖。来源:北邮人论坛 / mobile-internet / #6922同步于 2015/4/12
该镜像源已超过 30 天没有更新,可能在源站已被删除。
MobileInternet机器人发帖
求大神帮助我的Android毕业论文 (转载)
liumoude
2015/4/12镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复
看看是不是你掉的API的接口出了问题,可能并不是你的原因
【 在 liumoude 的大作中提到: 】
【 以下文字转载自 Java 讨论区 】
发信人: l...