我开发了一个应用程序,我在webview中加载我的youtube频道,它正如预期的那样正常工作。我能够以小屏幕和全屏模式播放视频。
但问题是,如果我将视频以全屏模式播放并将其置于前台应用程序崩溃时将应用程序置于后台。我已经看过崩溃日志,但它没有显示我的代码中的任何内容我没有得到崩溃背后的原因。它显示了NullPointerException但它来的地方是一个谜。
Logcat :
08-09 14:21:33.480: E/AndroidRuntime(10157): FATAL EXCEPTION: main
08-09 14:21:33.480: E/AndroidRuntime(10157): java.lang.NullPointerException
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.webkit.HTML5VideoFullScreen.prepareForFullScreen(HTML5VideoFullScreen.java:187)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.webkit.HTML5VideoFullScreen.access$600(HTML5VideoFullScreen.java:24)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.webkit.HTML5VideoFullScreen$2.surfaceCreated(HTML5VideoFullScreen.java:124)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.SurfaceView.updateWindow(SurfaceView.java:609)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:235)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.View.dispatchWindowVisibilityChanged(View.java:7678)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1047)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1335)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1112)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4472)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.Choreographer.doCallbacks(Choreographer.java:555)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.Choreographer.doFrame(Choreographer.java:525)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.os.Handler.handleCallback(Handler.java:615)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.os.Handler.dispatchMessage(Handler.java:92)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.os.Looper.loop(Looper.java:137)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
android.app.ActivityThread.main(ActivityThread.java:4898)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
java.lang.reflect.Method.invokeNative(Native Method)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
java.lang.reflect.Method.invoke(Method.java:511)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-09 14:21:33.480: E/AndroidRuntime(10157): at
dalvik.system.NativeStart.main(Native Method)
如果我只在小屏幕上播放视频时将应用程序放在后台,应用程序不会崩溃。