解决java.lang.IllegalStateException: The application’s PagerAdapter changed the adapter’s content
A界面中有viewpager的动态加载,从界面A跳到界面B,再finish掉B返回A时报出此异常。
java.lang.IllegalStateException:
The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged!
Expected adapter item count: 0, found: 1 Pager id: com.##.##.android:id/vp_pager Pager class: class android.support.v4.view.ViewPager Problematic adapter: class com.##.contacts.quickcontact.Activity$ViewPagerAdapter
- ::21.060: E/com.##.##.##.Application(): at android.support.v4.view.ViewPager.populate(ViewPager.java:)
- ::21.060: E/com.##.##.##.Application(): at android.support.v4.view.ViewPager.populate(ViewPager.java:)
- ::21.060: E/com.##.##.##.Application(): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:)
- ::21.060: E/com.##.##.##.Application(): at android.view.View.measure(View.java:)
- ::21.060: E/com.##.##.##.Application(): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:)
- ::21.060: E/com.##.##.##.Application(): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:)
- ::21.060: E/com.##.##.##.Application(): at android.widget.LinearLayout.measureVertical(LinearLayout.java:)
- ::21.060: E/com.##.##.##.Application(): at android.widget.LinearLayout.onMeasure(LinearLayout.java:)
我的解决办法是
在界面A的onResume()方法中调用这个viewpager的adapter.notifyDataSetChanged()方法,这样就OK了
解决java.lang.IllegalStateException: The application’s PagerAdapter changed the adapter’s content的更多相关文章
- 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext问题
使用ClassPathXmlApplicationContext加载项目时, ClassPathXmlApplicationContext context = new ClassPathXmlAppl ...
- 【转】解决java.lang.IllegalStateException: The content of the adapter has changed but ListView...的问题
原文网址:http://blog.csdn.net/ueryueryuery/article/details/20607845 我写了一个Dialog,Dialog中有一个ListView,想要点Li ...
- 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext这个问题
今天在运行别人的SSH项目时,遇到了这个问题 严重: Exception sending context initialized event to listener instance of class ...
- 开发问题及解决--java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=" ...
- The application’s PagerAdapter changed the adapter’s contents without calling PagerAdapter#notifyDa
错误原因是在于修改了PageAdapter,却没有调用 PageAdapter的nodifyDataSetChanged方法.注意刷新数据 需要在主线程. 今天在做项目时出现了这个问题,一直报没有调用 ...
- Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/Cppcc] due to a StackOverflowError. Possible root causes include a too low setting for -Xs
解决办法:(1)修改D:\Java\apache-tomcat-7.0.88\conf\catalina.properties (122line) (2)如org.apache.catalina.st ...
- java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/com.alibaba.druid.filter.Filter].
九月 11, 2019 2:56:36 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading ...
- myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...
- java.lang.IllegalStateException:Web app root system property already set to different value 错误原因及解决 Log4j
Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件.甚至是套接口 服务器.NT的事件记录器.UNIX Syslog守护进程等: ...
随机推荐
- Android4.1(Jelly Bean)API新特性尝鲜
原文:http://android.eoe.cn/topic/android_sdk Android 4.1 APIs (API Level: 16)http://developer.android. ...
- 关于Suppressing notification from package com.xxx.xxx by user request.的异常
其实以下都是废话. 如果你的测试的真机或者是模拟器是android4.1以上, 就有可能遇到这个Toast或者通知不能弹出. 自己不懂为什么. 想想你自己的应用设置是否有勾上这个 没有的话.就活该显示 ...
- [转载]关于generate用法的总结【Verilog】
转载自http://www.cnblogs.com/nanoty/archive/2012/11/13/2768933.html Abtract generate语句允许细化时间(Elaboratio ...
- flink Job提交过程
https://www.jianshu.com/p/0cdfa2a05ebd http://vinoyang.com/2017/04/02/flink-runtime-client-submit-jo ...
- pandas数组和numpy数组在使用索引数组过滤数组时的区别
numpy array 过滤后的数组,索引值从 0 开始. pandas Series 过滤后的 Series ,保持原来的索引,原来索引是几,就是几. 什么意思呢,来看个栗子: import num ...
- angular的uiRouter服务学习(4)
本篇接着上一篇angular的uiRouter服务学习(3)继续讲解uiRouter的用法 本篇主要讲解uiRouter的url路由 大多数情况下,状态是和url相关联的: 当url改变,激活对应的状 ...
- Sql Server 查询库表记录数
), RowCnt INT) EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?' desc DROP TA ...
- C++11 override和final
30多年来,C++一直没有继承控制关键字.最起码这是不容易的,禁止一个类的进一步衍生是可能的但也很棘手.为避免用户在派生类中重载一个虚函数,你不得不向后考虑. C++ 11添加了两个继承控制关键字:o ...
- 【驱动】DM9000网卡驱动分析
Preface 内核源码版本:linux-2.6.18 网卡驱动·linux内核网络分层结构:http://infohacker.blog.51cto.com/6751239/122114 ...
- Eclipse 使用 SVN 插件后修改用户方法汇总
http://blog.csdn.net/ShaneLooLi/article/details/50994005 ******************************************* ...