android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

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 Stack Overflow by sama
, 1 year ago
Unable to add window -- token null is not for an application
via Stack Overflow by arpitgoyal2008
, 2 years ago
Unable to add window -- token null is not for an application
via GitHub by alexeyvasilyev
, 8 months ago
Unable to add window -- token null is not valid; is your activity running?
via Stack Overflow by Shan Michael Reyes
, 2 months ago
Unable to add window -- token android.os.BinderProxy@bc0afcf is not valid; is your activity running?
via GitHub by mike-stetsenko
, 1 year ago
Unable to add window android.view.ViewRootImpl$W@142544eb -- permission denied for this window type
via Stack Overflow by Unknown author, 2 years ago
Unable to add window -- token null is not for an application
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.view.ViewRootImpl.setView(ViewRootImpl.java:804)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:288)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:73)
at android.app.Dialog.show(Dialog.java:287)
at ir.blog.trafik.BackGround.onPostExecute(BackGround.java:103)
at ir.blog.trafik.BackGround.onPostExecute(BackGround.java:22)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)

Users with the same issue

10 times, 3 months ago
19 times, 4 months ago
6 times, 7 months ago
4 times, 9 months ago
2 times, 10 months ago

Write tip

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