java.lang.IllegalArgumentException: The observer is null.终于解决方式
在使用数据适配的时候的问题:
java.lang.IllegalArgumentException: The observer is null.
at android.database.Observable.unregisterObserver(Observable.java:64)
at android.widget.BaseAdapter.unregisterDataSetObserver(BaseAdapter.java:42)
at android.widget.AbsListView.onDetachedFromWindow(AbsListView.java:2872)
at android.view.View.dispatchDetachedFromWindow(View.java:11908)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2647)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2645)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2685)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:4044)
at android.view.ViewRootImpl.die(ViewRootImpl.java:4027)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:375)
at android.view.WindowManagerImpl$CompatModeWrapper.removeViewImmediate(WindowManagerImpl.java:170)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3352)
at android.app.ActivityThread.access$1200(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
at dalvik.system.NativeStart.main(Native Method)
导致的问题所在是BaseAdapter
解决方式:在extends BaseAdapter的时候加入例如以下代码就可以:
@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
if (observer != null) {
super.unregisterDataSetObserver(observer);
}
}
希望能帮助你,加油!
这里也是我:我的eoe博客关于这个问题地址
java.lang.IllegalArgumentException: The observer is null.终于解决方式的更多相关文章
- 安卓java.lang.IllegalArgumentException: The observer is null.解决方案
刚刚在调试自己的APP项目的时候报错java.lang.IllegalArgumentException: The observer is null.,而之前是可以运行通过,所以百思不得其解,后来在网 ...
- java.lang.IllegalArgumentException: name MUST NOT NULL! at org.nutz.dao.impl.NutDao.fetch
Nutz传值报错问题 作者:Vashon 时间:20150902 平台:Nutz框架 Java后台方法中拿值时报的错 报错信息: java.lang.IllegalArgumentException: ...
- java.lang.IllegalArgumentException: Service Intent must be explicit 解决办法
java.lang.IllegalArgumentException: Service Intent must be explicit 意思是服务必须得显式的调用 我之前是这样使用绑定Service的 ...
- java.lang.IllegalArgumentException: host parameter is null
即 URL 应为 http://www.baidu.com 但是实际配置成了 www.baidu.com 所以出现此错误
- eclipse:java.lang.OutOfMemoryError: PermGen space 最简单的解决方式
我使用的工具是STS, Eclipse同理: 打开如下界面: 左则选择项目启动使用的Tomcat-->在右侧面板Tab项中选择" Arguments":在VM argumen ...
- 严重: End event threw exception java.lang.IllegalArgumentException: Can't convert argument: null
堆栈信息: 2014-6-17 10:33:58 org.apache.tomcat.util.digester.Digester endElement 严重: End event threw exc ...
- java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"报错
出现问题的原因: 内存用户验证时,Spring boot 2.0.1引用的security 依赖是 spring security 5.X版本,此版本需要提供一个PasswordEncorder的实例 ...
- 异常java.lang.IllegalArgumentException:attempt to create delete event with null entity
异常java.lang.IllegalArgumentException:attempt to create delete event with null entity解决:路径问题,前台jsp和ja ...
- eclipse maven构建的java web工程项目 在修改了工程项目名时,tomcat启动异常java.lang.IllegalArgumentException: Can't convert argument:null
问题 我修改了前一个项目的名称.重新启动该项目至tomcat,报错:Java.lang.IllegalArgumentException: Can't convert argument: null 因 ...
随机推荐
- [JZOJ4024] [佛山市选2015] 石子游戏 解题报告
Description Alice 和 Bob 总喜欢聚在一起玩游戏(T_T),今天他(她)们玩的是一款新型的取石子游戏.游戏一开始有N堆石子,Alice 和 Bob 轮流取出石子.在每次操作 ...
- BZOJ 球形空间产生器 解题报告(高斯消元)
题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1013 1013: [JSOI2008]球形空间产生器sphere 有一个球形空间产生器能 ...
- Word histogram
Here is a program that reads a file and builds a histogram of the words in the file: process_file lo ...
- core组件进阶
访问图像像素 存储方式 BGR连续存储有助于提升图像扫描速度. isContinuous()判断是否是连续存储. 颜色空间缩减 仅用这些颜色中具有代表性的很小的部分,就足以达到同样的效果. 将现有颜色 ...
- 二、Fast-R-CNN
一.概括 Fast R-cnn的主要亮点有:Fast R-CNN将借助多任务损失函数,将物体识别和位置修正合成到一个网络中,不再对网络进行分步训练,不需要大量内存来存储训练过程中特征的数据:用RoI层 ...
- 洛谷P3402 【模板】可持久化并查集
一定注意每一次都要是 $root[cur]=root[cur-1]$,不然进行合并时如果 $a,b$ 在同一集合中就会使 $root[cur]=0$. Code: #include <cstdi ...
- include、require、include_once和require_once的区别
/*** * 1.include 和 require 的文件可以有返回值 * 2.include 包含的文件不存在,会发出一个警告,但是不会停止执行代码. * require 在这种情况下会抛出错误并 ...
- twig 模板引擎使渲染视图更加优雅
在使用 laravel 的时候接触过 blade 模板引擎.在学习的时候,接触到了另外一个强大的模板引擎:twig 官网:https://twig.sensiolabs.org/ 中文手册:http: ...
- impala jdbc4的group by语句的bug,加上limit没错
这里用的ImpalaJDBC4.jar SELECT field1 alias1 FROM table1 where field1 ='xxxx' group by alias1 这句话impala会 ...
- CF 558A(Lala Land and Apple Trees-暴力)
A. Lala Land and Apple Trees time limit per test 1 second memory limit per test 256 megabytes input ...