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 因 ...
随机推荐
- Struts2标签库整理【完整】
转自:https://blog.csdn.net/chen_zw/article/details/8161230 Struts2标签库提供了主题.模板支持,极大地简化了视图页面的编写,而且,str ...
- Oracle 建表
-- Create table create table STUDENT ( sno ) not null, sname ) not null, ssex ) not null, sbirthday ...
- VS自定义开发向导中的vsdir文件的简单说明
作者:朱金灿 来源:http://blog.csdn.net/clever101 VS自定义开发向导中有一个vsdir文件.这个文件指定了在VS中项目的标题.默认工程名等内容.下面对vsdir文件做一 ...
- vue中使用滚动效果
new Vue({ el: '#app', data: function data() { return { bottom: false, beers: [] }; }, watch: { botto ...
- nginx 配置若干问题
配置nginx,遇到的几个小问题: 1. 报错信息: # nginx -t nginx: [warn] conflicting server name , ignored 分析解决: 配置文件中,重复 ...
- webpack(构建一个前端项目)详解--升级
升级一个正式的项目结构 分离webpack.config.js文件: 新建一个webpack.config.base.js任何环境依赖的wbpack //public webpack const pa ...
- 用 while 循环做个小游戏
import random #可输入次数 flag = 0 #生成一个1到10之间的随机整数 res = random.randint(1,10) #判读三次输入机会 while(flag<3) ...
- js001 ---- async
Node.js异步流,详细见https://caolan.github.io/async/docs.html#parallel 1, async 用的比较多的是 waterfall, 瀑布流, 就是每 ...
- 2014 CodingTrip - 携程编程大赛 (预赛第二场)
1001: 食物链(poj1182),直接贴代码,稍作可过 并查集 // // main.cpp // 携程1 // // Created by zhang on 14-4-11. // Copyri ...
- CMSIS-RTOS 时间管理之时间延迟Time Delay
时间管理 Time Management 此RTOS除了可以把你的应用代码作为线程运行,它还可以提供一些时间服务功能,使用这些功能你就可以访问RTOS的一些系统调用. 时间延迟Time Delay 在 ...