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 因 ...
随机推荐
- 3339: Rmq Problem
Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 1269 Solved: 665[Submit][Status][Discuss] Descripti ...
- T_SQL 字符串函数
字符串函数用于处理列中的数据值,通常属于字符型的数据类型. 1.ASCLL(character),将具体字符转换为相应的整数(ASCII)代码,结果为正数. 例:select ASCII('A'), ...
- Monad的基本运算
A monad is created by defining a type constructor M and two operations, bind and return (where retur ...
- MySQL服务启动:某些服务在未由其他服务或程序使用时将自动停止
这几天因为工作需求,需要把MySQL请出来,所以将尘封已久的MySQL进行启动.可是事与愿违,兴许是许久没有访问MySQL了,MySQL生气的不理我,并向外抛出一阵阵报错.1.其中一个是:Window ...
- POJ2299 树状数组求逆序对
裸题,不多解释. #include<iostream> #include<cstdio> #include<algorithm> #include<cstri ...
- [POI2012]HUR-Warehouse Store(贪心,堆)
题意 n天.第i天上午会进货Ai件商品,中午的时候会有顾客需要购买Bi件商品,可以选择满足顾客的要求,或是无视掉他. 如果要满足顾客的需求,就必须要有足够的库存.问最多能够满足多少个顾客的需求. (n ...
- jumpserver 安装python 报错
环境centos7.5 pip3 insatll ./python-gssapi-0.6.4.tar.gz 报错 Command "python setup.py egg_info&quo ...
- clear---清除当前屏幕
clear命令用于清除当前屏幕终端上的任何信息.
- python在leecode刷题-第一题和第七题
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] num ...
- 【模板】2-SAT 问题(2-SAT)
[模板]2-SAT 问题 题目背景 2-SAT 问题 模板 题目描述 有n个布尔变量 \(x_1\) ~ \(x_n\) ,另有m个需要满足的条件,每个条件的形式都是" \(x_i\) ...