安卓:NullPointerException异常上的WebView异常、NullPointerException、WebView

2023-09-08 10:04:45 作者:承诺、都苍白得让人可笑

有没有人有这个问题?我不太明白如何解决它。不知道是我的code造成网页视图此异常或错误。

  

显示java.lang.NullPointerException在  android.webkit.WebViewClassic $ WebViewInputConnection.setNewText(WebViewClassic.java:587)  在  android.webkit.WebViewClassic $ WebViewInputConnection.setComposingText(WebViewClassic.java:327)  在  android.webkit.WebViewClassic $ WebViewInputConnection.commitText(WebViewClassic.java:343)  在  com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:279)  在  com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)  在android.os.Handler.dispatchMessage(Handler.java:107)在  android.os.Looper.loop(Looper.java:194)在  android.app.ActivityThread.main(ActivityThread.java:5371)在  java.lang.reflect.Method.invokeNative(本机方法)的  java.lang.reflect.Method.invoke(Method.java:525)在  com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:833)  在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)在  dalvik.system.NativeStart.main(本机方法)

解决方案

 显示java.lang.NullPointerException在android.webkit.WebViewClassic $ WebViewInputConnection.setNewText(WebViewClassic.java:587)在android.webkit.WebViewClassic $ WebViewInputConnection.setComposingText(WebViewClassic.java:327)在com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:333) 

我昨天得到了同样的错误,我想这是从全新的lib产生的Google Play-services.jar

如果您发现该片段中,的AdMob 更新是强制性的,以缓解这一问题。

关于iOS 9你需要知道的10件事

Does anyone have this problem? I am not quite understand how to fix it. Not sure is that my code cause this exception or a bug on a webview.

java.lang.NullPointerException at android.webkit.WebViewClassic$WebViewInputConnection.setNewText(WebViewClassic.java:587) at android.webkit.WebViewClassic$WebViewInputConnection.setComposingText(WebViewClassic.java:327) at android.webkit.WebViewClassic$WebViewInputConnection.commitText(WebViewClassic.java:343) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:279) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5371) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method)

解决方案

java.lang.NullPointerException
at android.webkit.WebViewClassic$WebViewInputConnection.setNewText(WebViewClassic.java:587)
at android.webkit.WebViewClassic$WebViewInputConnection.setComposingText(WebViewClassic.java:327)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:333)

I got the same error yesterday, I think it is generated from lib of new google-play-services.jar.

If you observe the snippet, admob update is mandatory to mitigate the issue.