android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@40a8f0f0 is not valid; is your activity running?

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Apereo Issues by Jeff Cross, 1 year ago
Unable to add window -- token android.view.ViewRoot$W@40a8f0f0 is not valid; is your activity running?
via Apereo Issues by Jeff Cross, 1 year ago
Unable to add window -- token android.view.ViewRoot$W@40a8f0f0 is not valid; is your activity running?
via Stack Overflow by Salman Siddiqui
, 2 years ago
Unable to add window -- token android.os.BinderProxy@406a6678 is not valid; is your activity running?
via Stack Overflow by Nick Hagianis
, 2 years ago
Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@44e933d8 is not valid; is your activity running?
via xamarin.com by Unknown author, 1 year ago
Unable to add window -- token android.os.BinderProxy@40727ec0 is not valid; is your activity running?
android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@40a8f0f0 is not valid; is your activity running?
at android.view.ViewRoot.setView(ViewRoot.java:527)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:465)
at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:370)
at android.webkit.WebView.startDrag(WebView.java:5624)
at android.webkit.WebView.onTouchEvent(WebView.java:5355)
at android.view.View.dispatchTouchEvent(View.java:3901)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1714)
at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2195)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1879)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3835)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.