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.终于解决方式的更多相关文章

  1. 安卓java.lang.IllegalArgumentException: The observer is null.解决方案

    刚刚在调试自己的APP项目的时候报错java.lang.IllegalArgumentException: The observer is null.,而之前是可以运行通过,所以百思不得其解,后来在网 ...

  2. java.lang.IllegalArgumentException: name MUST NOT NULL! at org.nutz.dao.impl.NutDao.fetch

    Nutz传值报错问题 作者:Vashon 时间:20150902 平台:Nutz框架 Java后台方法中拿值时报的错 报错信息: java.lang.IllegalArgumentException: ...

  3. java.lang.IllegalArgumentException: Service Intent must be explicit 解决办法

    java.lang.IllegalArgumentException: Service Intent must be explicit 意思是服务必须得显式的调用 我之前是这样使用绑定Service的 ...

  4. java.lang.IllegalArgumentException: host parameter is null

    即 URL 应为 http://www.baidu.com  但是实际配置成了  www.baidu.com 所以出现此错误

  5. eclipse:java.lang.OutOfMemoryError: PermGen space 最简单的解决方式

    我使用的工具是STS, Eclipse同理: 打开如下界面: 左则选择项目启动使用的Tomcat-->在右侧面板Tab项中选择" Arguments":在VM argumen ...

  6. 严重: 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 ...

  7. java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"报错

    出现问题的原因: 内存用户验证时,Spring boot 2.0.1引用的security 依赖是 spring security 5.X版本,此版本需要提供一个PasswordEncorder的实例 ...

  8. 异常java.lang.IllegalArgumentException:attempt to create delete event with null entity

    异常java.lang.IllegalArgumentException:attempt to create delete event with null entity解决:路径问题,前台jsp和ja ...

  9. eclipse maven构建的java web工程项目 在修改了工程项目名时,tomcat启动异常java.lang.IllegalArgumentException: Can't convert argument:null

    问题 我修改了前一个项目的名称.重新启动该项目至tomcat,报错:Java.lang.IllegalArgumentException: Can't convert argument: null 因 ...

随机推荐

  1. 将一个文件夹纳入library或者移除remove

    https://support.microsoft.com/en-us/help/4026298/windows-show-libraries-in-file-explorer To show lib ...

  2. 英语影视台词---五、And Then There Were None

    英语影视台词---五.And Then There Were None 一.总结 一句话总结:求阿加莎·克里斯蒂小说<无人生还>的英文版<And Then There Were No ...

  3. 9. IntelliJ Idea 集成svn 和使用

    转自:http://www.cnblogs.com/zhanghaoliang/p/6206948.html 最近公司的很多同事开始使用IntelliJ Idea,便尝试了一下,虽然快捷键与eclip ...

  4. java9新特性-7-语法改进:接口的私有方法

    1.官方Feature 213: Milling Project Coin Support for private methods in interfaces was briefly in consi ...

  5. PostgreSQL Replication之第七章 理解Linux高可用(6)

    7.6 PostgreSQL和高可用性 数据库是我们日常数字生活的一部分,并期望它们快速工作. 您浏览网上论坛吗?那个帖子在数据库中.您看医生吗?您的医疗记录在数据库中.您在网上购物吗?那个货物,您的 ...

  6. POJ 1320 Street Numbers(佩尔方程)

    Street Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3078   Accepted: 1725 De ...

  7. The view 'Index' or its master was not found or no view engine supports the

    ASP.net  MVC 5  WebApi部署IIS提示: 未找到视图“索引”或其母版视图,或没有视图引擎支持搜索的位置.搜索了以下位置: 其他设置一切正常 这种情况很有可能是,1.部署的路径中空格 ...

  8. Ubuntu18.06 Mate桌面环境下VirtuslBox打开虚拟机“全局菜单”异常退出解决办法

    在安装完Ubuntu18.06 Mate桌面环境后在VirtuslBox里打开虚拟机会出现“全局菜单”异常退出问题. 产生上面问题的原因是你的虚拟机可能在 显示= >屏幕= >硬件加速里勾 ...

  9. Shell应用之网卡流量监测

    需求分析 1)按固定时间监测一次网卡流量 2)当网卡流量为0时重启网卡 一.网卡流量查询 sar(System ActivityReporter系统活动情况报告)是目前Linux上最为全面的系统性能分 ...

  10. vuex 闲置状态重置方案

    前言 大型单页应用(后面都是指spa),我们往往会通过使用状态管理器 vuex 去解决组件间状态共享与状态传递等问题.这种应用少则几十个单页,多则上百个单页.随着路由的频繁切换,每个路由对应的 vue ...