Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.view.WindowManager$BadTokenException

I have a strange issue. I got this crash report from Crashlyitics. This seems doesn't show any line my activity code. So i didn't know when this error happened. Please anyone have idea when this exception happened. Any possible scenario?

android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
       at android.view.ViewRootImpl.setView(ViewRootImpl.java:692)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:345)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
       at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
       at android.view.Window$LocalWindowManager.addView(Window.java:556)
       at android.widget.MediaController.show(MediaController.java:338)
       at android.webkit.HTML5VideoFullScreen.showControllerInFullScreen(HTML5VideoFullScreen.java:386)
       at android.webkit.HTML5VideoViewProxy$VideoPlayer.end(HTML5VideoViewProxy.java:311)
       at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:432)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4895)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
       at dalvik.system.NativeStart.main(NativeStart.java)
like image 257
Amsheer Avatar asked Nov 10 '22 03:11

Amsheer


1 Answers

It seems, below line of code causes the app crash which actually generating and showing some dialog window that never get dismiss / cancel when Activity (screen) is destroyed. please check whatever dialogs opening by that screen all those are closed or dismiss before that activity getting destroy.

at android.widget.MediaController.show(MediaController.java:338)

like image 153
Laxman Kumar Avatar answered Nov 24 '22 21:11

Laxman Kumar