错误:java.lang.IllegalArgumentException: Receiver not registered

 Caused by: java.lang.IllegalArgumentException: Receiver not registered: [email protected]
 at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:861)
 at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1352)
 at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:576)
 at com.multak.cookaraclient.MainActivity.onStop(MainActivity.java:493)
 at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1288)
 at android.app.Activity.performStop(Activity.java:6534)
 at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:35
 at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3588) 
 at android.app.ActivityThread.access$1200(ActivityThread.java:165) 
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loop(Looper.java:150) 

修改:在OnCreate注册时,就在 OnDeatory 反注册。保证(register, unregister)成对出现

时间: 2024-08-02 07:01:53

错误:java.lang.IllegalArgumentException: Receiver not registered的相关文章

java.lang.IllegalArgumentException: Receiver not registered

错误提示:java.lang.IllegalArgumentException: Receiver not registered. 顾名思义就是Receiver没有被注册,这是由于取消了没有注册的Receiver导致的错误. 我们使用Receiver时必须保证注册(register)和反注册(unregister)成对出现. 遇到这种问题时,你需要检查下自己代码中注册和反注册的代码,看下是否存在多次调用unregister的时候. 很多时候都是想当然认为会那样,但是程序中可能有我们未预料的出口,

Android - java.lang.IllegalArgumentException: Receiver not registered

java.lang.IllegalArgumentException: Receiver not registered 从平台上可以看到Crash的错误问题, 出现了以下这条 java.lang.IllegalArgumentException: Receiver not registered 明明我OnResume有注册.OnPause有移除. 但为什么会发生这个问题 private BroadcastReceiver mReceiver = new BroadcastReceiver() {

Android广播接收器注册问题:Caused by: java.lang.IllegalArgumentException: Receiver not registered

1.程序中明明使用如下方法进行了广播的注册和解除注册: mContext.registerReceiver(downloadReceiver, filter); mContext.unregisterReceiver(downloadReceiver); 但程序运行过程中还是有一下问题: android.app.IntentReceiverLeaked: Activity *********** has leaked IntentReceiver *********** that was ori

java.lang.IllegalArgumentException: Service not registered

java.lang.IllegalArgumentException: Service not registered 首先检查一下,Service是否在AndroidManifest文件中注册.格式如下: <service   android:name=".MyService"  ></service> 如果Service已经注册了,还是会报这个错误的话,可能是 1.bindService没有成功,就直接unbindService: 2.也可能是已经unbind

解决多指操作放大缩小 指针错误 java.lang.IllegalArgumentException: pointerIndex out of range

/** Custom your own ViewPager to extends support ViewPager. java source: */ /** Created by azi on 2013-6-21. */ package com.chaokuadi.android.support.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEv

Glide错误java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity

解决办法 在使用Glide的那段代码加是否在主线程判断 if(Util.isOnMainThread()) { Glide.with(ClassifyItemDetailActivity.this).load(ConstantsYiBaiSong.CLASSIFY_LIST_ITEM_DETAIL_IMAGE + lists.get(i).get( "face")) .diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView); }

HTTP错误:java.lang.IllegalArgumentException: Illegal character in scheme at index 0: ?http://xxxxxx

读取T卡文件里的域名,HTTP请求出现如下错误 java.lang.IllegalArgumentException: Illegal character in scheme at index 0: http://xxxxxxxxxxx at java.net.URI.create(URI.java:727) at org.apache.http.client.methods.HttpPost.<init>(HttpPost.java:84) ...... 出现该错误时,读取域名的代码如下 p

java.lang.IllegalArgumentException: Registered more than one instance with the same objectName

java.lang.IllegalArgumentException: Registered more than one instance with the same objectName <May 25, 2017 12:29:19 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <May 25, 2017 12:29:19

Android 多点触控错误处理(java.lang.IllegalArgumentException: pointerIndex out of range)

最近做View的多点触控时,每次第一次触控事件完美运行,第二次就直接崩了,错误信息如下: 01-03 00:05:44.220 4377-4410/system_process E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.ui java.lang.IllegalArgumentException: pointerIndex out of range at android.view.MotionEvent.nat