1:将XListView制作成Android Library,然后将其导入到工作空间中
2:新建Module,将其作为Module dependencies添加进来。
3:在布局文件中添加XListView组件(包名加类名的形式)
XListViewxlv=findViewById(R.id.xlv);
xlv.setPullLoadEnable(true);//上拉加载更多
xlv.setPullRefreshEnable(true);//下拉刷新
xlv.setXListViewListener(new XListView.IXListViewListener(){
publicvoid onRefresh() {//刷新接口回调
publicvoid onLoadMore() {//加载更多接口回调
Datedate=new Date(System.currentTimeMillis());
SimpleDateFormatsdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");