NullPointerException异常的handleStopActivity - 没有提到我的code的堆栈跟踪 [英] NullPointerException in handleStopActivity -- No reference to my code in stack trace

查看:284
本文介绍了NullPointerException异常的handleStopActivity - 没有提到我的code的堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点不知所措,在这里。我已经看到在 handleStopActivity A数量也在不断增加,这些 NullPointerException异常取值。我怀疑是增加的增加,2.2升级到Droid的业主coinicides,虽然这只是一个猜测。我从来没有见过的碰撞自己,由市场提供的堆栈跟踪并没有提到任何我写的类。因此,我不知道从哪里开始解决问题。

I'm a bit at a loss, here. I've been seeing a steadily increasing number of these NullPointerExceptions in handleStopActivity. I suspect that the increase coinicides with the increase in 2.2 upgrades to Droid owners, though that's just a guess. I've never seen the crash myself, and the stack trace provided by the market does not mention any of the classes I've written. As such, I have no idea where to start in fixing the problem.

java.lang.NullPointerException
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3674)
at android.app.ActivityThread.access$2600(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)

由于我不知道原因,我也不知道什么样的信息,以提供以帮助诊断,所以我给了overiew: 我的应用程序是WootWatcher。它跟踪Woot.com并通知销售新项目的用户。它由运行在单独的进程的服务的手段做到这一点。经由AIDL接口和回调彼此服务和主活动通信。我还利用消息处理器同时在服务和活动,并经常生成线程昂贵的任务。

Since I don't know the cause, I also don't know what information to provide to aid in diagnosis, so I'll give an overiew: My app is WootWatcher. It tracks Woot.com and notifies users of new items for sale. It does this by means of a service that runs in a separate process. The service and the main activity communicate with each other via aidl interface and callback. I also make use of message handlers in both the service and activity, and frequently spawn threads for expensive tasks.

推荐答案

回顾这4年的老问题,我知道我应该能够诊断它,可惜我找不到它的任何版本的AOSP的这些线路匹配。 Droid的一定是使用了不提供源的一些修改过的版本。

Looking back at this 4-year old question, I realize I should be able to diagnose it, but unfortunately I can't find any version of AOSP for which these lines match up. The Droid must have used some altered version of the source that wasn't made available.

这是说,升级Froyo的 handleStopActivity()并没有很多机会空指针异常。最有可能的人会指向 Activity.finish()时,活动已经停止,或者正在停止的过程。

That said, Froyo's handleStopActivity() doesn't have many opportunities for a null pointer exception. The most likely one would point to Activity.finish() when the Activity has already been stopped, or is in the process of being stopped.

这通常发生在你注册听众,最终调用发生完成(),你不注销的的onPause这些听众()

This usually happens when you register listeners that eventually call finish() and you don't unregister those listeners in onPause().

这篇关于NullPointerException异常的handleStopActivity - 没有提到我的code的堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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