{"
weatherinfo
":{"
city
":"北京","
cityid
":"101010100","
temp1
":"15℃","temp2":"5℃","weather":"多云","img1":"d1.gif","img2":"n1.gif","ptime":"08:00"}}
new Thread() {
public void run() {
try {
Map<String, Object> map = new HashMap<String, Object>();
String str = HttpUtil.doGet(
url1 = "
http://www.weather.com.cn/adat/cityinfo/"
+ url2 + ".html", map);
// 将string转换为jsonobject
JSONObject jsonObject0 = new JSONObject(str);
// 解析jsonobject里面的值
JSONObject jsonObject1 = jsonObject0
.getJSONObject("
weatherinfo");
city_ = jsonObject1.getString("
city");
cityid_ = jsonObject1.getString("
cityid");
temp2_ = jsonObject1.getString("temp2");
temp1_ = jsonObject1.getString("temp1");
weather_ = jsonObject1.getString("weather");
ptime_ = jsonObject1.getString("ptime");
handler.sendEmptyMessage(1);