首页 > 其他 > 详细

下拉加载延迟方法

时间:2016-08-23 16:13:07      阅读:201      评论:0      收藏:0      [点我收藏+]

xListView.setXListViewListener(new IXListViewListener() {

            // 下拉刷新的回调方法
            public void onRefresh() {

                data.clear();

                // TODO Auto-generated method stub

                zixiancheng();
                new Handler().postDelayed(new Runnable() {
                    public void run() {
                        count = 20;
                        xListView.stopRefresh();
                    }
                }, 1000);

                // // 下拉刷新,应该展示最新数据,所以清空集合
                // arrayAdapter.notifyDataSetChanged();
                //
                // // 设置刷新时间
                // xListView.setRefreshTime(dateFormat());
                // // 停止加载更多
                // xListView.stopLoadMore();
                // // 停止刷新
                // xListView.stopRefresh();

            }

            // //上拉加载的回调方法
            public void onLoadMore() {

                zixiancheng();
                new Handler().postDelayed(new Runnable() {

                    public void run() {
                        count += 20;
                        xListView.stopLoadMore();
                    }
                }, 1000);

                // arrayAdapter.notifyDataSetChanged();
                //
                // // 停止加载更多
                // xListView.stopLoadMore();
                // // 停止刷新
                // xListView.stopRefresh();
            }
        });

下拉加载延迟方法

原文:http://www.cnblogs.com/tiankonglan/p/5799526.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!