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博客关于这个问题地址

时间: 2024-07-31 08:21:32

java.lang.IllegalArgumentException: The observer is null.最终解决方案的相关文章

严重: 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 exception java.lang.IllegalArgumentException: Can't convert argument: null at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:1

java.lang.IllegalArgumentException: Can't convert argument: null

从SVN下载项目后,我把项目名称改了一下然后启动tomcat后就一直报java.lang.IllegalArgumentException: Can't convert argument: null这个错. 解决办法是:第一步.将web.xml文件的头文件以javaee:开始的命名空间删除.如图: 第二步:将web.xml文件中所有javaee:替换成空白.如图: 重启tomcat,问题解决! java.lang.IllegalArgumentException: Can't convert a

java.lang.IllegalArgumentException: clusterListener can not be null

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: clusterListener can not be null at org.s

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

今天在配置spring-security.xml配置文件时出错 错误如下: 严重: Servlet.service() for servlet [security] in context with path [] threw exception java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" at org.springframework.security.c

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: There is no PasswordEncoder mapped for the id "null" 并且页面毫无响应. 解决方法: 创建PasswordEncorder的实现类MyPassw

java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity

今天想把ssh整合的代码跑起来,控制台就一直在报错,搞了半天!!! Hibernate: select computer0_.computerId as computer1_0_, computer0_.computerName as computer2_0_, computer0_.computerPrice as computer3_0_, computer0_.computerType as computer4_0_ from computer computer0_java.lang.Il

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null”

在spring security中设置默认的登录人的信息,遇到的异常信息: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null” 有些版本不要求这样子做,所以就不会有该问题的发生, 我现在用的是5.0版本,强制要求提供一个,所以我们就给一个PasswordEncoder给他. 我们也可以使用Spring自带的PasswordEncoder.为了方便起见,我们以明文形式存密码

解决java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

问题描述: 使用springboot,权限管理使用spring security,使用内存用户验证,但无响应报错: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 解决方式 ①: 创建MyPasswordEncoder类实现PasswordEncoder,加注解  @Component @Component public class MyPasswordEn

Mybatis java.lang.IllegalArgumentException: uncategorized SQLException for SQL []; SQL state [null]

1.数据库字段原类型为Date 类型,因为数据原因,将该字段换为String类型,结果导致Mybatis 报出java.lang.illegalargumentexception, 因为数据库的变动我并不知晓,所以这个问题查了好久 2.解决过程 首先认为是SQL原因,但是Mybatis 组装的语句放到PLSQL中执行没有错误 接下来定位到数据库更换是不是有地方不一样,结果找到了有相同命名的一个字段,原数据库类型为Date ,改变数据库后,字段类型为String 下面就定位到执行SQL后,返回的数