我有带有 webview 的应用程序,我使用ACRA。我收到来自用户的崩溃报告,其中包含与HTML5Video
.
错误一:
"java.lang.NullPointerException
at android.webkit.HTML5VideoViewProxy$VideoPlayer.exitFullScreenVideo(HTML5VideoViewProxy.java:180)
at android.webkit.HTML5VideoViewProxy.exitFullScreenVideo(HTML5VideoViewProxy.java:770)
at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:7422)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)"
错误2:
"java.lang.NullPointerException
at android.webkit.HTML5VideoFullscreen.switchProgressView(HTML5VideoFullscreen.java:455)
at android.webkit.HTML5VideoView.enterFullscreenVideoState(HTML5VideoView.java:546)
at android.webkit.HTML5VideoViewProxy$VideoPlayer.enterFullscreenVideo(HTML5VideoViewProxy.java:182)
at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:479)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5485)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
at dalvik.system.NativeStart.main(Native Method)"
如果需要,这是我的DropBox日志:
对于错误 1: http: //pastebin.com/w8G1UJvG
似乎很有趣:
11-14 22:19:29.912 E/libEGL (14744): call to OpenGL ES API with no current context (logged once per thread)
11-14 22:19:29.917 W/dalvikvm(14744): threadid=1: thread exiting with uncaught exception (group=0x40d4a2d0)
对于错误 2: http: //pastebin.com/8BEK1vAm
似乎很有趣:
12-10 00:14:52.542 W/YourLogTag(24823): Couldn't find activity to view mimetype: video/x-m4v
事实上,我什至不建议在我的 webview 中与 HTML5 视频进行交互。我想,用户从页面打开它们,也没有提供与之交互。此外,我认为尝试禁止用户与其他网页交互是一种不好的方式(对于我的应用程序可能真的很难)。而且,当崩溃对话框出现在他面前时,用户绝对不会对我的应用程序感到温暖......
所以我想在我的 webview 中阻止用户与 HTML5 视频的交互,或者只是正确地捕获异常(似乎不是很好的方法)。最好的方法是什么?
如果需要,这是我的 webview 设置:
webView.getSettings().setJavaScriptEnabled(false);
webView.getSettings().setUserAgentString("Some user agent");