protected void cdxgServlet() {
// TODO Auto-generated method stub
String url=Util.httpURL+"cdxgServlet";
String paraname[]={"cdid","cm","jg","js","tp"};
String paravalue[]={idValue,cmValue,jgValue,jsValue,tpValue};
JSONArray jsonainfo =Connect.dopost(url, paraname, paravalue, 5,"info");
if(jsonainfo==null)
{
Toast.makeText(Xiugaicaidan.this, "暂时无法读取数据!", Toast.LENGTH_LONG)//点击时,报这句话"暂时无法读取数据!",jsonainfo我已经检查了几次都没发现空值,cdxgServlet写的也没问题
.show();
}
else
{
JSONObject jsonobject;
try {
for(int i=0;i<jsonainfo.length();i++)
{
jsonobject = jsonainfo.getJSONObject(i);
String fanhui=jsonobject.getString("fanhui");
Toast.makeText(Xiugaicaidan.this, fanhui, Toast.LENGTH_LONG)
.show();
}
Toast.makeText(Xiugaicaidan.this, "读取数据成功!", Toast.LENGTH_LONG)
.show();
} catch (Exception e) {
Toast.makeText(Xiugaicaidan.this, "读取数据失败!", Toast.LENGTH_LONG)
.show();
}
}
}