这是错误提示:
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityTh
这是代码:
```private Handler listHandler = new Handler() {
public void handleMessage(Message msg) {
List<Map<String, String>> result = (List<Map<String, String>>) msg.obj;
switch (msg.what) {
case AutoListView.REFRESH:
lv_wanzheng.onRefreshComplete();
//listCount.clear();
listCount.addAll(result);
break;
case AutoListView.LOAD:
lv_wanzheng.onLoadComplete();
listCount.addAll(result);
break;
}
lv_wanzheng.setResultSize(result.size());
wanzhengAdapter.notifyDataSetChanged();
};
};
new Thread(new Runnable() {
@Override
public void run() {
Message msg = new Message();
msg.what = whatNum;
msg.obj = getData();
listHandler.sendMessage(msg);
}
}).start();
private List<Map<String, String>> getData() {
JsonMessage jm = new JsonMessage();
String[] title = jm.getTitle();
String[] time = jm.getTime();
String[] image1 = jm.getimage1();
String[] image2 = jm.getimage2();
String[] url = jm.getUrl();
List<Map<String, String>> listdata = new ArrayList<Map<String, String>>();
for (int i = 0; i < image1.length; i++) {
Map<String, String> map = new HashMap<String, String>();
map.put("title", title[i]);
map.put("time", time[i]);
map.put("image1", image1[i]);
map.put("image2", image2[i]);
map.put("url", url[i]);
listdata.add(map);
}
return listdata;
}