zoukankan      html  css  js  c++  java
  • The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged

    log信息如下:10-10 12:31:14.186: E/AndroidRuntime(22835): java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 0, found: 4 Pager id: com.example.app:id/viewpager Pager class: class android.support.v4.view.ViewPager Problematic adapter: class com.example.Share.ViewPagerAdapter

    解决方法 http://www.cnblogs.com/ivan240/archive/2013/07/23/3208570.html:

    在初始化ViewPager时,应先给Adapter初始化内容后再将该adapter传给ViewPager,
    如果不这样处理,在更新adapter的内容后,应该调用一下adapter的notifyDataSetChanged方法,
    否则在ADT22以上使用会报The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged的异常,
    具体原因可参考:http://stackoverflow.com/questions/16756131/fragmentstatepageradapter-stopped-working-after-updating-to-adt-22
  • 相关阅读:
    持续集成-禅道
    nohup.out 日志切分
    Flannel 介绍及使用场景
    【Unity游戏开发】初探Unity动画优化
    fastHttp服务端处理请求的过程
    PHPExcel导出文件代码实现
    PHPExcel 1.8
    CKfinder 安装与使用
    Ckeditor的配置
    Ckeditor的使用
  • 原文地址:https://www.cnblogs.com/sklww/p/3361074.html
Copyright © 2011-2022 走看看