The content of the adapter has changed but ListView did not receive a notification
来源:互联网 发布:林佳一是谁的女儿知乎 编辑:程序博客网 时间:2024/05/20 06:26
The content of the adapter has changed but ListView did not receive a notification.
原因:没有在主线程里通知。。。。
1、bug 出现的地方 listView.class 1487行
if (mItemCount == 0) {
2、mItemCount != mAdapter.getCount()?
AdapterView.class 172行
3、AdapterView.class ?
ListView extends AbsListView
AbsListView extends AdapterView<ListAdapter>
4、网上主要解决方式
mAffairList.setVisibility(View.GONE);
mAdapter.notifyDataSetChanged();
mAffairList.setVisibility(View.VISIBLE);
只能解决主动通知时的情况,大多数情况是没有通知造成的
5、mAdapter.notifyDataSetChanged() 在做什么事?
点进去
class BaseAdapter
点进去
class DataSetObservable
abstract class DataSetObserver
public void onChanged() {
AdapterView.class中
class AdapterDataSetObserver extends DataSetObserver {
6、理论上的解决方式
listView所加载的list是静态的,大小不会变
只要list的size()变化了,就马上发通知
7、我的建议
只要list的size()变化了,就马上发通知
对主list的size()的改变与通知更新会存在时间差,滚动listView时不改变主list大小会大大减少bug产生,或者尽量减少动画
转载自http://blog.sina.com.cn/s/blog_3e333c4a01011kpd.html
- 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.
- 再谈java事件监听机制
- Java程序员常用工具集
- java 设计模式之一工厂模式
- 双向广搜 模板
- 个人修改的用于ADS1.2的2440init.s
- The content of the adapter has changed but ListView did not receive a notification
- Android系统的Binder机制之四——系统Service
- 辞职后五险一金怎么处理
- 自定义UITableViewCell
- C#中获取版本号的方法
- pkg-config的使用
- 为什么LBS应用允许多位赢家共存的局面
- iphonewax框架下上传应用出现non-public API usage ...... waxsim:SBApplication 解决办法
- OpenVPN的配置和使用