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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)