The content of the adapter has changed but ListView did not receive a notification
来源:互联网 发布:杭州淘宝拍摄 编辑:程序博客网 时间:2024/06/10 08:22
android 新手,在开发中遇到第一次见到的一个错误java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131296805, class android.widget.ListView) with Adapter(class cn.lingox.android.adapter.ChatAllHistoryAdapter)],查阅了好多资料也看到了android大牛的博客等 等,说的一些解决 此问题的方式, 我采用了一种比较简单的方式
重写 notifyDataSetChanged()方法,在方法中获取集合的大小,然互在getcount 中返回集合大小即可
@Override
public void notifyDataSetChanged() {
size = datas.size();
super.notifyDataSetChanged();
}
getcount中返回集合大小
@Override
public int getCount() {
// return datas.size();
return size;
}
- listview提示The content of the adapter has changed but ListView did not receive a notification
- ListView异常:The content of the adapter has changed but ListView did not receive a notification
- ListView The content of the adapter has changed but ListView did not receive a notification.
- The content of the adapter has changed but ListView did not receive a notification.
- The content of the adapter has changed but ListView did not receive a notification
- 解决bug:The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification.
- The content of the adapter has changed but ListView did not receive a notification
- .解决bug:The content of the adapter has changed but ListView did not receive a notification .
- The content of the adapter has changed but ListView did not receive a notification终极解决方法
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- The content of the adapter has changed but ListView did not receive a notification错误分析
- The content of the adapter has changed but ListView did not receive a notification 异常解析
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- The content of the adapter has changed but ListView did not receive a notification终极解决方法
- The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification.
- StringUtils 类方法
- 纯CSS苹果菜单
- 互联网中广泛使用的优秀框架
- #利用C语言-EasyX图形设计-制作简易计算器#
- 响应式布局之-MediaQueries
- The content of the adapter has changed but ListView did not receive a notification
- Android应用架构之Retrofit使用
- mall2
- 调用约定
- 基因数据处理47之ART基因序列数据生成器(仿真)
- [直观学习排序算法] 视觉直观感受若干常用排序算法
- C primer plus 第十章 练习2:
- JiamiJiemi
- JavaScript经验总结