ChooserActivity渗漏IntentReceiver [英] ChooserActivity has leaked IntentReceiver

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

问题描述

  E / ActivityThread(655):活动com.android.internal.app.ChooserActivity有
泄露IntentReceiver com.android.internal.app.ResolverActivity$1@412f4f38
最初这里注册。

是否缺少调用unregisterReceiver()? E / ActivityThread(655):
android.app.IntentReceiverLeaked:
活动com.android.internal.app.ChooserActivity渗漏IntentReceiver
com.android.internal.app.ResolverActivity$1@412f4f38这原是
在这里注册。是否缺少调用unregisterReceiver()?
 

  1. 是什么错误是什么意思?
  2. 由于应用程序继续工作,我应该忽略它?
  3. 我怎样才能解决这个问题?

当我选择从手机图库下面贴在例行<图像它发生href="http://www.$c$crzheaven.com/2012/04/20/select-an-image-from-gallery-in-android-and-show-it-in-an-imageview/"相对=nofollow>此处。 当我preSS在活动的布局定义的浏览图库按钮precisely。


全部logcat的:

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

解决方案

我知道这是旧的,但我有同样的问题,并认为我偶然发现了事故的答案,尽管它很奇怪。

在模拟器,如果你做一些事来引起应用程序管理器,如A股的意图,或选择它似乎只有一个例外,如果只有一个应用程序,并自动加载应用程序,而你选择一个画廊的应用程序。

例如,要选择一个图像。如果你运行你的日常选择图像,你将最有可能有几个选择,出现在你的手机上选择对话框。然而在模拟器上,你很少有什么比只是默认库的应用程序等。

当它只是一个应用程序,它加载,你会得到一个例外。

如果您有多个应用程序可供选择,你会得到也不例外。

如果你想分享一个文本文件,同样的事情发生。在模拟器上的文本文件将自动直接加载了一个消息应用程序,你会得到一个异常。

如果您在设置电子邮件应用程序,它会显示在选择器两个应用程序。你不会有任何例外。

我相信你可以放心地忽略这一点,因为它似乎是一个内部错误消息。

您可以尝试通过安装第二个库的应用程序重现此看到它没有创造一个错误消息。

我只注意到,这也说明了同样的建议 http://stackoverflow.com/a/10290486/935779

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

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天全站免登陆