Android 无法捕获的 NullPointerException

Android uncatchable NullPointerException(Android 无法捕获的 NullPointerException)

本文介绍了Android 无法捕获的 NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用中有一个非常烦人的 NPE,但找不到解决方案.首先是堆栈跟踪:

I have a pretty annoying NPE in my app and can't find a solution. First the stack trace:

09-12 23:27:32.855: ERROR/AndroidRuntime(19152): java.lang.NullPointerException
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at android.webkit.WebView.stopLoading(WebView.java:1737)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at c$a.run(Unknown Source)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at android.os.Handler.handleCallback(Handler.java:587)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at android.os.Handler.dispatchMessage(Handler.java:92)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at android.os.Looper.loop(Looper.java:130)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at android.app.ActivityThread.main(ActivityThread.java:3835)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at java.lang.reflect.Method.invokeNative(Native Method)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at java.lang.reflect.Method.invoke(Method.java:507)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
09-12 23:27:32.855: ERROR/AndroidRuntime(19152):     at dalvik.system.NativeStart.main(Native Method)

当我快速切换方向时会发生 NPE.有人有同样的经历吗?有解决办法吗?另外我需要提一下,我使用 Admob.我不知道这个 NPE 还会出现在 WebView 的什么地方.

The NPE occures when I switch the orientation very fast. Does somebody experience tha same? Is there a solution? Also I need to mention, that I use Admob. I don't know where else this NPE could occure in a WebView.

提前致谢!

推荐答案

我回答了我自己的问题:通过正确的关键字,我终于在 Google 找到了一些不错的结果.这绝对是一个 Admob 问题.如果你有兴趣,可以看看这个帖子

I answer my own question: With the right keywords I've finally found some good hits at Google. That is definitively an Admob issue. If your are interested in, take a look at this thread

http://groups.google.com/组/google-admob-ads-sdk/browse_thread/thread/1f79640c499bbabc

这篇关于Android 无法捕获的 NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Android 无法捕获的 NullPointerException

基础教程推荐