Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NullPointerException when entering video in full screen webview nokia x

Hi I am searching the workaround for this problem from past two days but still I have not get any solution. In webview I am playing YouTube video the video works fine when I click on it but if I click on Full Screen icon the app crash with the below errors. I tried overriding onShowCustomeView in WebCromeClient but it does not works. I tried all solutions from WebView and HTML5 <video> thread.The solutions works for android phone I tested it on Lg g2 and xperia p and nexus 7 but on nokia x it still crash. Is there any way I can stop video from playing full screen or playing at all.

04-03 10:12:50.769 E/AndroidRuntime( 3867): java.lang.NullPointerException

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.view.ViewGroup.addViewInner(ViewGroup.java:3384)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.view.ViewGroup.addView(ViewGroup.java:3256)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.view.ViewGroup.addView(ViewGroup.java:3232)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.webkit.HTML5VideoFullscreen.enterFullscreen(HTML5VideoFullscreen.java:253)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.webkit.HTML5VideoView.enterFullscreenVideoState(HTML5VideoView.java:535)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.webkit.HTML5VideoViewProxy$VideoPlayer.enterFullscreenVideo(HTML5VideoViewProxy.java:183)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:476)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.os.Handler.dispatchMessage(Handler.java:99)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.os.Looper.loop(Looper.java:137)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at android.app.ActivityThread.main(ActivityThread.java:4807)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at java.lang.reflect.Method.invokeNative(Native Method)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at java.lang.reflect.Method.invoke(Method.java:511)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:559)

    04-03 10:12:50.769 E/AndroidRuntime( 3867):     at dalvik.system.NativeStart.main(Native Method)

    04-03 10:12:50.769 I/ActivityManager(  571): Notify an ApplicationCrash
like image 326
Sunny Avatar asked Oct 21 '22 11:10

Sunny


1 Answers

Look this

overriding that method to return a non-null View object (for instance, a bogus 0x0 View in your layout) and see if you still crash

         @Override
         public View getVideoLoadingProgressView() { 
           FrameLayout frameLayout = new FrameLayout(getSherlockActivity());    
           frameLayout.setLayoutParams(new LayoutParams( LayoutParams.MATCH_PARENT,    
          LayoutParams.MATCH_PARENT));
           return frameLayout;
         }
like image 105
Sree Avatar answered Oct 23 '22 04:10

Sree