无限上拉下拉XlistView 有时候就会出现 适配器内容已经改变,但列表视图没有收到通知。求解,为什么!内有详细说明。

来源:互联网 发布:中国臭氧层空洞知乎 编辑:程序博客网 时间:2024/04/29 05:17
1.当我上拉或者下拉XlistView的时候  我在上拉下拉方法中启动查询数据的线程。
2.线程查询的数据不为空的时候,给适配器适配数据。
3.适配如下:  传过去两个list    当你一直上拉或者下拉的时候就会报  适配器内容已经改变 但列表视图没收到通知了
               if (commentAdapter == null) {
commentAdapter = new CommentAdapter(this, list_comment, list_comment_child);
lv_user_comments.setAdapter(commentAdapter);

lv_user_comments.setPullRefreshEnable(true);
}else{
commentAdapter.notifyDataSetChanged();

lv_user_comments.setPullRefreshEnable(true);

0 0
原创粉丝点击