//1.查找组件
xlv = findViewById(R.id.xlv);
//2.进行配置
xlv.setPullRefreshEnable(true);//支持下拉刷新
xlv.setPullLoadEnable(true);//支持上拉加载更多
3.设置监听事件
xlv.setXListViewListener(new XListView.IXListViewListener() {
public void onRefresh() {//刷新
}
public void onLoadMore() {//加载更多
}
if(operType==1){//刷新
//关闭头视图
xlv.stopRefresh();
//关闭头视图
xlv.stopRefresh();
Date date=new Date(System.currentTimeMillis());
SimpleDateFormat sformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String timeStr = sformat.format(date);
xlv.setRefreshTime(timeStr);//设置刷新时间
SimpleDateFormat sformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String timeStr = sformat.format(date);
xlv.setRefreshTime(timeStr);//设置刷新时间
}else {
//关闭footer视图
xlv.stopLoadMore();
}
//关闭footer视图
xlv.stopLoadMore();
}