这是我更新listview的代码
Handler handler = new Handler(){
List> listItemx = new ArrayList>();
public void handleMessage(android.os.Message msg) {
if (msg.arg1 == 0X456) {
listItemx = (List>) msg.obj;
SimpleAdapter simpleAdapter = new SimpleAdapter(getActivity(), listItemx, R.layout.weather_simple_item,
new String[]{"city", "lowtemp", "hightemp", "week", "curTemp", "type", "fengli", "aqi"},
new int[]{R.id.city, R.id.lowtemp, R.id.hightemp, R.id.week, R.id.curTemp, R.id.type, R.id.fengli, R.id.aqi});
ListView list = (ListView) getView().findViewById(R.id.chat_weathers);
// 为ListView设置Adapter
list.setAdapter(simpleAdapter);
simpleAdapter.notifyDataSetChanged();
}
}
};
求大神啊