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

Stack Overflow | sama | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    having error when showing alertDialog in asyncTask that is called from service?

    Stack Overflow | 9 months ago | sama
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  2. 0

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

    GitHub | 3 years ago | mntgoat
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  3. 0

    Unable to add window -- token null is not for an application

    GitHub | 3 years ago | banxi1988
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    CrashManager.register() requires an Activity Context, not just any Context

    GitHub | 4 years ago | gregschlom
    java.lang.RuntimeException: Unable to resume activity {com.foo.app/com.foo.app.MyActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  6. 0

    NPE in Custom DialogBox

    Stack Overflow | 4 years ago | nafi
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.view.WindowManager$BadTokenException

    Unable to add window -- token null is not for an application

    at android.view.ViewRootImpl.setView()
  2. Android Platform
    Dialog.show
    1. android.view.ViewRootImpl.setView(ViewRootImpl.java:804)
    2. android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:288)
    3. android.view.WindowManagerImpl.addView(WindowManagerImpl.java:73)
    4. android.app.Dialog.show(Dialog.java:287)
    4 frames
  3. ir.blog.trafik
    BackGround.onPostExecute
    1. ir.blog.trafik.BackGround.onPostExecute(BackGround.java:103)
    2. ir.blog.trafik.BackGround.onPostExecute(BackGround.java:22)
    2 frames
  4. Android Platform
    ActivityThread.main
    1. android.os.AsyncTask.finish(AsyncTask.java:631)
    2. android.os.AsyncTask.access$600(AsyncTask.java:177)
    3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
    4. android.os.Handler.dispatchMessage(Handler.java:99)
    5. android.os.Looper.loop(Looper.java:176)
    6. android.app.ActivityThread.main(ActivityThread.java:5493)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:525)
    2 frames
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)
    2 frames
  7. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(Native Method)
    1 frame