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

cnblogs.com | 4 weeks 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

    Android对话框之Context - bvin - 博客园

    cnblogs.com | 4 weeks ago
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  2. 0

    error while adding alertdialog box in fragment

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

    Cannot open spinner with alert dialog in android

    Stack Overflow | 11 months ago | Wai Yan Hein
    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

    Applicaton has stopped error after create instance of AlertDialog

    Stack Overflow | 1 year ago | The.Only.One
    android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  6. 0

    How to handle the fatal exception(bad token exception) in android

    Stack Overflow | 1 year ago | xyz
    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
    AlertDialog$Builder.show
    1. android.view.ViewRootImpl.setView(ViewRootImpl.java:576)
    2. android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:269)
    3. android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
    4. android.app.Dialog.show(Dialog.java:289)
    5. android.app.AlertDialog$Builder.show(AlertDialog.java:951)
    5 frames
  3. cn.bvin.app
    MainActivity$1.onClick
    1. cn.bvin.app.androidtest_asgit.MainActivity$1.onClick(MainActivity.java:24)
    1 frame
  4. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:4446)
    2. android.view.View$PerformClick.run(View.java:18480)
    3. android.os.Handler.handleCallback(Handler.java:733)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:136)
    6. android.app.ActivityThread.main(ActivityThread.java:5294)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:515)
    2 frames
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
    2 frames
  7. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(Native Method)
    1 frame