1.在pullListView的头尾加上刷新和加载更多的布局 ~~~ LayoutInflater layoutInflater = LayoutInflater.from(UserTaskList.this); Lastview = layoutInflater.inflate(R.layout.list_footview, null); RelativeLayout footerView = (RelativeLayout) Lastview .findViewById(R.id.list_footview); moreProgressBar = (ProgressBar) Lastview.findViewById(R.id.footer_progress); pullListView.addFooterView(footerView); ~~~ 2.把获取的数据绑定自定义的适配器 ~~~ TaskAdapter listItemAdapter = new TaskAdapter(this, tasklist); pullListView.setAdapter(listItemAdapter); ~~~ 3.添加item点击事件 ~~~ pullListView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, Object> item = (HashMap<String, Object>) parent .getItemAtPosition(position); intent = new Intent(UserTaskList.this, TaskDetails.class); intent.putExtra("task_id", item.get("id").toString()); startActivity(intent); } }); ~~~ 4.下拉刷新监听器 ~~~ pullListView.setonRefreshListener(new OnRefreshListener() { public void onRefresh() { new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); tasklist.removeAll(tasklist); page = 1; tasklist.addAll(TaskDP.getGoodTask( Integer.valueOf(strStutas), page, strType, UserTaskList.this)); myHandler.sendEmptyMessage(LOAD_NEW_INFO); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); } }); ~~~ 5.点击加载更多 ~~~ footerView.setOnClickListener(new OnClickListener() { public void onClick(View v) { moreProgressBar.setVisibility(View.VISIBLE); new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); page++; tasklist.addAll(TaskDP.getGoodTask( Integer.valueOf(strStutas), page, strType, UserTaskList.this)); myHandler.sendEmptyMessage(LOAD_MORE_SUCCESS); } catch (InterruptedException e) { e.printStackTrace(); } } }).start(); } }); ~~~ 6.Handler处理结果 ~~~ private Handler myHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case LOAD_MORE_SUCCESS: moreProgressBar.setVisibility(View.GONE); listItemAdapter.notifyDataSetChanged(); pullListView.setSelectionfoot(); break; case LOAD_NEW_INFO: listItemAdapter.notifyDataSetChanged(); pullListView.onRefreshComplete(); break; default: break; } } }; ~~~