XListView xListView = (XListView) view.findViewById(R.id.xListView);
// 激活加载更多
xListView.setPullLoadEnable(true);
// 激活下拉刷新
xListView.setPullRefreshEnable(true);
// 设置xlistView上拉加载下拉刷新的监听
xListView.setXListViewListener(new IXListViewListener() {
@Override
// 下拉刷新的回调方法
public void onRefresh() {
data();
// 设置刷新时间
xListView.setRefreshTime(dateFormat());
// 停止加载更多
xListView.stopLoadMore();
// 停止刷新
xListView.stopRefresh();
}
@Override
// //上拉加载的回调方法
public void onLoadMore() {
// 停止加载更多
xListView.stopLoadMore();
// 停止刷新
xListView.stopRefresh();
}
});
data();
return view;
}
/**
* 格式化毫秒值
*
* @return
*/
private String dateFormat() {
long currentTimeMillis = System.currentTimeMillis();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String format = dateFormat.format(currentTimeMillis);
return format;
}
// 激活加载更多
xListView.setPullLoadEnable(true);
// 激活下拉刷新
xListView.setPullRefreshEnable(true);
// 设置xlistView上拉加载下拉刷新的监听
xListView.setXListViewListener(new IXListViewListener() {
@Override
// 下拉刷新的回调方法
public void onRefresh() {
data();
// 设置刷新时间
xListView.setRefreshTime(dateFormat());
// 停止加载更多
xListView.stopLoadMore();
// 停止刷新
xListView.stopRefresh();
}
@Override
// //上拉加载的回调方法
public void onLoadMore() {
// 停止加载更多
xListView.stopLoadMore();
// 停止刷新
xListView.stopRefresh();
}
});
data();
return view;
}
/**
* 格式化毫秒值
*
* @return
*/
private String dateFormat() {
long currentTimeMillis = System.currentTimeMillis();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String format = dateFormat.format(currentTimeMillis);
return format;
}