ChooserActivity已泄漏IntentReceiver [英] ChooserActivity has leaked IntentReceiver

查看:122
本文介绍了ChooserActivity已泄漏IntentReceiver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  E / ActivityThread(655):Activity com.android.internal.app.ChooserActivity has 
leaked IntentReceiver com.android.internal.app.ResolverActivity$1@412f4f38 $ b最初在这里注册的$ b。

您是否丢失了对unregisterReceiver()的调用? E / ActivityThread(655):
android.app.IntentReceiverLeaked:
活动com.android.internal.app.ChooserActivity已泄漏IntentReceiver
com.android.internal.app.ResolverActivity$1@412f4f38原来这里是
。您是否忘记了对unregisterReceiver()的调用?




  1. 这个错误是什么意思?

  2. 由于应用程序继续工作,应该忽略吗?

  3. 如何解决?

当我从电话库中选择图像时,会发生这样的情况:



如果你真的想避免这种异常,它有一个更复杂的工作。


E/ActivityThread(  655): Activity com.android.internal.app.ChooserActivity has
leaked IntentReceiver com.android.internal.app.ResolverActivity$1@412f4f38 
that was originally registered here. 

Are you missing a call to unregisterReceiver()? E/ActivityThread(  655): 
android.app.IntentReceiverLeaked: 
Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver 
com.android.internal.app.ResolverActivity$1@412f4f38 that was originally 
registered here. Are you missing a call to unregisterReceiver()?

  1. What does this error mean?
  2. Since the application continues working should I ignore it?
  3. How can I fix it?

It occurs when I choose an image from the phone Gallery following the routine posted here. Precisely when I press the Browse Gallery Button defined in the layout of the Activity.


Full LOGCAT:

E/ActivityThread(  655):    at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:763)
E/ActivityThread(  655):    at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:567)
E/ActivityThread(  655):    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1043)
E/ActivityThread(  655):    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1030)
E/ActivityThread(  655):    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1024)
E/ActivityThread(  655):    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:341)
E/ActivityThread(  655):    at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:65)
E/ActivityThread(  655):    at com.android.internal.app.ResolverActivity.onCreate(ResolverActivity.java:99)
E/ActivityThread(  655):    at com.android.internal.app.ChooserActivity.onCreate(ChooserActivity.java:53)
E/ActivityThread(  655):    at android.app.Activity.performCreate(Activity.java:4465)
E/ActivityThread(  655):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/ActivityThread(  655):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/ActivityThread(  655):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/ActivityThread(  655):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/ActivityThread(  655):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/ActivityThread(  655):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/ActivityThread(  655):    at android.os.Looper.loop(Looper.java:137)
E/ActivityThread(  655):    at android.app.ActivityThread.main(ActivityThread.java:4424)
E/ActivityThread(  655):    at java.lang.reflect.Method.invokeNative(Native Method)
E/ActivityThread(  655):    at java.lang.reflect.Method.invoke(Method.java:511)
E/ActivityThread(  655):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/ActivityThread(  655):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/ActivityThread(  655):    at dalvik.system.NativeStart.main(Native Method)

解决方案

I know this is older, but I've had the same issue and think I stumbled across the answer on accident, though it's strange.

Within the emulator, if you do something to cause an application picker such as a share intent or to choose a gallery app it appears to only have an Exception if there is only one application and automatically loads the application without you choosing one.

For example, you want to pick an image. If you run your routine to select an image you will most likely have a few choices appear in a chooser dialog on your phone. However on the emulator, you rarely have anything other than just the default Gallery application.

When it's only one application and it loads, you get an Exception.

If you have multiple applications to choose from, you'll get no Exception.

The same thing happens if you want to share a text file. On the emulator the text file will automatically load up a Messaging application directly and you'll get an Exception.

If you setup the Email application, it'll show two applications in a chooser. You'll have no Exception.

I believe you can safely ignore this since it appears to be an internal error message.

You can try to reproduce this by installing a second gallery application to see it not creating an error message.

I just noticed this also describes the same suggestion http://stackoverflow.com/a/10290486/935779

It has a more complicated work around if you really want to avoid this Exception.

这篇关于ChooserActivity已泄漏IntentReceiver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆