The application’s PagerAdapter changed the adapter’s contents without calling PagerAdapter#notifyDa

简介:

错误原因是在于修改了PageAdapter,却没有调用 PageAdapter的nodifyDataSetChanged方法。注意刷新数据 需要在主线程。

 

今天在做项目时出现了这个问题,一直报没有调用nodifyDataSetChanged,找了半天,是因为在退出到登陆界面时,没有将注册的监听清除掉,导致为同一个注册多个监听,导致报错。



    本文转自 一点点征服   博客园博客,原文链接:http://www.cnblogs.com/ldq2016/p/5383727.html ,如需转载请自行联系原作者




相关文章
|
6月前
|
XML 数据格式
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
32 0
Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c
原因: 1.组件名没写对(导入和注册不对应) 2.components少写了个s 3.组件命名最好是驼峰命名 4.导入时语法错误 5.代码中有两个components,后一个的值把前一个覆盖了 6.组件直接循环套用了
101 0
the content is displayed over another view controller’s content
the content is displayed over another view controller’s content
128 0
the content is displayed over another view controller’s content
|
Java
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
156 0
Could not find class 'android.support.v4.view.ViewPager', referenced from method***
|
Android开发
Only the original thread that created a view hierarchy can touch its views.
/********************************************************************************** * Only the original thread that created a view hierarchy can touch its views. * 说明: * 自定义view的时候出现这个错误,是用错了方法。
1102 0